Form Paint event : Form Event « GUI Windows Form « C# / C Sharp
- C# / C Sharp
- GUI Windows Form
- Form Event
Form Paint event
using System;
using System.Drawing;
using System.Windows.Forms;
class PaintEvent
{
public static void Main()
{
Form form = new Form();
form.Text = "Paint Event";
form.Paint += new PaintEventHandler(MyPaintHandler);
Application.Run(form);
}
static void MyPaintHandler(object objSender, PaintEventArgs pea)
{
Graphics graphics = pea.Graphics;
graphics.Clear(Color.Chocolate);
}
}
Related examples in the same category