C#实现渐变颜色的Windows窗体控件!
1,定义一个BaseFormGradient,继承于System.Windows.Forms.Form
2,定义三个变量:
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3,重载OnPaintBackground方法
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
4,定义一个新窗体GradientForm,继承BaseFormGradient.
public class GradientForm : BaseFormGradient
5,在窗体GradientForm中,设置_Color1,_Color2,_ColorAngle
1,定义一个BaseFormGradient,继承于System.Windows.Forms.Form
2,定义三个变量:
3,重载OnPaintBackground方法
4,定义一个新窗体GradientForm,继承BaseFormGradient.
public class GradientForm : BaseFormGradient
5,在窗体GradientForm中,设置_Color1,_Color2,_ColorAngle
转载于:https://www.cnblogs.com/xyqCreator/archive/2012/08/18/2645628.html