Paint event of the form from the form properties
window.
2.then add the method in your form -
private void frmMain_Paint(object sender, PaintEventArgs e)
{
base.OnPaintBackground(e);
Graphics g = e.Graphics;
Rectangle bounds = new Rectangle(Point.Empty, this.Size);
if (bounds.Width > 0 && bounds.Height > 0)
{
using (Brush b = new LinearGradientBrush(bounds,
Color.White, Color.Green,LinearGradientMode.Horizontal))
{
g.FillRectangle(b, bounds);
}}}
3.run your application,you will see nice gradient
color.change color from White and Green to your
favourite colors and run app again.