Protected Override Void OnPaint (Painteventargs PE)
{
Graphics g = pe.graphics;
/ / Set the position and size of the rectangular area
Rectangle Rect = New Rectangle (0, 0, 200, 200);
/ / Make the color of the filled rectangle from red to yellow gradient
LINEARGRADIENTBRUSH LBRUSH = New Lineargradientbrush (Rect, Color.red, Color.Yellow,
Lineargradientmode.BackWardDiagonal);
g.fillRectangle (LBRUSH, RECT);
}