Create a class library project, add a customControl item to the solution, then make that class inherits from Panel instead of Control and override the OnPaint method to be like this:
protected override void OnPaint(PaintEventArgs e)
{
if (this.ClientRectangle.Height == 0 this.ClientRectangle.Width == 0) return;
Graphics g = e.Graphics;
LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, BackColor1, BackColor2, FillMode);
g.FillRectangle(brush, this.ClientRectangle);
}
build and get the dll, add it to your toolbox and use it instead of the normal Panel, by the way you can do the same thing to all controls to have a better UI
I'm a professional components designer, web developer, UX engineer and 3d designer as well, I'm 4 years experienced .net software engineer and 7 years experienced 3d designer using 3D Max. I'm very interested in RIA technologies, prototyping and UX engineering.
Ahmed Said
Senior .Net Software Engineer