Share via


WizardForm.OnPaint(PaintEventArgs) Method

Definition

Indicates that the wizard form is being redrawn, and raises the Paint event.

protected:
 override void OnPaint(System::Windows::Forms::PaintEventArgs ^ e);
protected override void OnPaint (System.Windows.Forms.PaintEventArgs e);
override this.OnPaint : System.Windows.Forms.PaintEventArgs -> unit
Protected Overrides Sub OnPaint (e As PaintEventArgs)

Parameters

e
PaintEventArgs

A PaintEventArgs that contains the event data.

Remarks

If implemented in your code, this method is called when the wizard form is redrawn. This occurs each time the form is drawn (for example, upon an initial load, when a page is changed, or when the user drags another window onto the wizard form). This method enables you to create a custom OnPaint method.

In this custom method, you should call the base.OnPaint(e) method to draw the wizard form.

Raising an event invokes the event handler through a delegate. For more information, see Raising an Event.

The OnPaint method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors

When overriding OnPaint(PaintEventArgs) in a derived class, be sure to call the base class’s OnPaint(PaintEventArgs) method so that registered delegates receive the event.

Applies to