各位好!我想把我写的渐变颜色填充到一个GroupBox里面作为背景色
this.r = new Rectangle(120,10,50,50);
this.lg = new LinearGradientBrush(r,Color.Blue,Color.White,LinearGradientMode.ForwardDiagonal);
..........
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.FillRectangle(lg,this.groupbox1.this.groupBox1.ClientRectangle);
}
请问大家,这样有错吗?
如果不对,请帮忙给个解决方案,谢谢!
this.r = new Rectangle(120,10,50,50);
this.lg = new LinearGradientBrush(r,Color.Blue,Color.White,LinearGradientMode.ForwardDiagonal);
..........
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.FillRectangle(lg,this.groupbox1.this.groupBox1.ClientRectangle);
}
请问大家,这样有错吗?
如果不对,请帮忙给个解决方案,谢谢!
解决方案 »
- windows ce 里怎样绑定dataGrid
- XML 节点的复制
- vs调试asp.net出现错误,如图
- C# gridview中放了dropdownlist控件,关于读取dropdownlist控件ID的问题
- 控件backcolor问题
- 求ASP.Net C# 防止刷新自动触发事件的解决方案
- 麻烦给推荐本C#的经典教材
- 求助啊,基本问题,可真的卡住我啦,谁帮帮我啊!!!怎么样在一个事件里引用别的控件的事件啊!!!在线等啊!!!
- 请问谁有做过类似QQ的任务栏图标如果有一条新的消息来的时候便闪动这个闪动怎么做呀
- WebClient下载文件出错,如果才能跳过这个错误,继续执行?
- "回卷,回卷"帮忙看看,谢谢
- 插入数据,急!!!!
楼上所提是正确的,修改谁的背景就要在谁的OnPaint事件中处理
另外e.Graphics.FillRectangle(lg,this.groupbox1.this.groupBox1.ClientRectangle);
好像多了一个this.groupbox1.