2021
01-17
01-17
C# 实现颜色渐变窗体控件详细讲解
1.建议设置窗体为双缓冲绘图,可有效避免界面刷时引起的闪烁this.SetStyle(ControlStyles.AllPaintingInWmPaint|ControlStyles.OptimizedDoubleBuffer,true);2、代码实现privateColorColor1=Color.Gray;//起始颜色privateColorColor2=Color.White;//目标颜色privatefloatchangeAngle=0f;//渐变角度3.窗体绘制函数privatevoidForm1_Paint(objectsender,PaintEventArgse){Graphicsg=e.Gra...
继续阅读 >