Hi,
The paint event occurs when a control needs repainting. And the Paint Event handler generally takes two parameters, for example:
Code Block
private void btnTest_Paint(object sender, PaintEventArgs e)
{
//�/span>
}
Where Sender represents the source of the event; e is a PaintEventArgs variable that contains the event data.
From your code, if you’d like to repaint some control, you can set OnPaint as the Paint event handler of that control, and then invoke the InValidate method of that control. The system will automatically produce the parameters and invoke OnPaint to repaint that control.
Take an example as illustration, assume that you’d like to repaint a button control “btnTestPaint� you can add following code to “button1_Click�
Code Block
btnTestPaint.Paint += new PaintEventHandler(onPaint);
btnTestPaint.Invalidate();
Hope this helps!