Share via


WizardForm.OnPageChanged(EventArgs) Method

Definition

Indicates that the user has moved from the current page to the previous or next page of the wizard form.

protected:
 virtual void OnPageChanged(EventArgs ^ e);
protected virtual void OnPageChanged (EventArgs e);
abstract member OnPageChanged : EventArgs -> unit
override this.OnPageChanged : EventArgs -> unit
Protected Overridable Sub OnPageChanged (e As EventArgs)

Parameters

e
EventArgs

A EventArgs that contains the event data.

Examples

The following example demonstrates the OnPageChanged method. In this example, the OnPageChanged method determines the current wizard page and sets the task caption. This code example is part of a larger example provided for the WizardForm class.

// Customize the OnPageChanged method
protected override void  OnPageChanged(EventArgs e)
{
    // To get to the LabelPage the user has been validated.
    if (this.CurrentPage.Name == "demoModuleWizardLabelPage")
    {
        this.TaskCaption = "User is signed in";
    }
    base.OnPageChanged(e);
}
// Customize the OnPageChanged method
protected override void  OnPageChanged(EventArgs e)
{
    // To get to the LabelPage the user has been validated.
    if (this.CurrentPage.Name == "demoModuleWizardLabelPage")
    {
        this.TaskCaption = "User is signed in";
    }
    base.OnPageChanged(e);
}

Remarks

If implemented in your code, this method is called when the user has moved from one page to another in the wizard form. This method enables you to create a custom OnPageChanged method. Clicking the Previous or Next button will change a wizard page and will result in a call to this method after the next page is loaded.

Applies to

See also