Share via


WizardPage.UpdateWizard Method

Definition

Provides a mechanism to update the wizard display.

protected:
 void UpdateWizard();
protected void UpdateWizard ();
member this.UpdateWizard : unit -> unit
Protected Sub UpdateWizard ()

Examples

The following example demonstrates the UpdateWizard method. In this example, the user has been satisfactorily validated and the CanNavigateNext property has been set to true. An update of the wizard is required to enable the Next button.

// Customize the CanNavigateNext property. This property
// is set to false until the user is validated.
private void button1_Click(object sender, EventArgs e)
{
    // Perform user validation checks. If this is a valid
    // user move to the next page. If the user is not a valid
    // user, exit the application.
    // User validation.
    string text = "Did the user pass validation?";
    MessageBoxButtons buttons = MessageBoxButtons.YesNo;
    MessageBoxIcon icon = MessageBoxIcon.Information;
    MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Button2;
    DialogResult result = ShowMessage(text, buttons, icon, defaultButton);
    if (result == DialogResult.No)
    {
        Application.Exit();
    }
    else
    {
        _canNavigateNext = true;
        this.UpdateWizard();
        ShowHelp();
    }
}

Remarks

Call this method when you need to refresh the wizard display. This method enables you to create a custom UpdateWizard method.

Applies to