Error Rectangle '{X=0,Y=0,Width=0,Height=0}' cannot have a width or height equal to 0.
class Gradient : Panel
{
public Color ColorTop { get; set; }
public Color ColorBottom { get; set; }
protected override void OnPaint(PaintEventArgs e)
{
LinearGradientBrush lgb = new LinearGradientBrush(this.ClientRectangle, this.ColorTop, this.ColorBottom, 90F);
Graphics g = e.Graphics;
g.FillRectangle(lgb, this.ClientRectangle);
base.OnPaint(e);
}
}