1、实现渐变色背景

渐变色背景

 1  private void Form1_Paint(object sender, PaintEventArgs e)
 2         {
 3             Paint_Background(this.Left,this.Width,this.Height, e);
 4         }
 5 
 6         private void Paint_Background(int Left, int Width, int Height, PaintEventArgs e)
 7         {
 8             Rectangle r = new Rectangle(Left, 0, Width, Height);
 9             System.Drawing.Drawing2D.LinearGradientBrush brush =
10                 new System.Drawing.Drawing2D.LinearGradientBrush(
11                     r, 
12                     Color.FromArgb(175, 210, 255),                                //颜色1
13                     Color.White,                                                  //颜色2
14                     System.Drawing.Drawing2D.LinearGradientMode.Vertical);
15             e.Graphics.FillRectangle(brush, e.ClipRectangle);
16         }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2021-12-16
  • 2022-01-12
  • 2021-10-14
  • 2021-09-03
猜你喜欢
  • 2021-12-23
  • 2021-10-27
  • 2021-12-20
  • 2021-10-22
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案