日期:2014-05-17 浏览次数:20860 次
panel1为Winfrom中的一个panel控件对象。 Graphics g = this.panel1.CreateGraphics(); Color FColor = Color.Blue; Color TColor = Color.Green; System.Drawing.Brush b = new LinearGradientBrush(this.panel1.ClientRectangle, FColor, TColor, LinearGradientMode.ForwardDiagonal); g.FillRectangle(b, this.panel1.ClientRectangle); this.panel1.Refresh(); g.Dispose();