通用C#代码:实现"控件渐变"

private void XXX控件_Paint(object sender, PaintEventArgs e)
{
Rectangle r = new Rectangle(0, 0, e.ClipRectangle.Width, e.ClipRectangle.Height);
e.Graphics.FillRectangle(new LinearGradientBrush(r, Color.SeaGreen, Color.LightGreen, LinearGradientMode.BackwardDiagonal), r);
}

你可能感兴趣的:(C++,c,C#)