Share via


WizardForm.OnClosing(CancelEventArgs) Method

Definition

Indicates that the form is closing, and raises the Closing event.

protected:
 override void OnClosing(System::ComponentModel::CancelEventArgs ^ e);
protected override void OnClosing (System.ComponentModel.CancelEventArgs e);
override this.OnClosing : System.ComponentModel.CancelEventArgs -> unit
Protected Overrides Sub OnClosing (e As CancelEventArgs)

Parameters

e
CancelEventArgs

A CancelEventArgs that contains the event data.

Remarks

If implemented in your code, this method is called when the wizard form is closed either programmatically or when the user clicks the Cancel or Close button. This method enables you to create a custom OnClosing method.

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

The OnClosing 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 OnClosing(CancelEventArgs) in a derived class, be sure to call the base class’s OnClosing(CancelEventArgs) method so that registered delegates receive the event.

Applies to