重载窗体的背景颜色

 

1  protected override void OnPaintBackground(PaintEventArgs e)
2  {
3   LinearGradientBrush b = new LinearGradientBrush(this.ClientRectangle,
4    Color.Blue,Color.AliceBlue,90f); //线性渐变
5   e.Graphics.FillRectangle(b,this.ClientRectangle); // 填充窗体
6   b.Dispose(); // 释放资源
7  }

8
posted on 2006-01-04 10:40  CIPCHK  阅读(814)  评论(2编辑  收藏  举报