protected override void OnPaintBackground(PaintEventArgs e)
{
Rectangle r = this.ClientRectangle;
if (r.Width > 0 && r.Height > 0)
{
using(LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, Color.MintCream, Color.DodgerBlue, 90 F))
{
e.Graphics.FillRectangle(brush, this.ClientRectangle);
}
}
}This code snippet for Give Windows Form Background as gradient color
