Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WizardControl.SelectedPageChanging Event

Enables you to control whether a wizard page can be selected.

Namespace: DevExpress.XtraWizard

Assembly: DevExpress.XtraWizard.v24.2.dll

NuGet Package: DevExpress.Win

#Declaration

public event WizardPageChangingEventHandler SelectedPageChanging

#Event Data

The SelectedPageChanging event's data class is WizardPageChangingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets whether the operation must be canceled.
Direction Gets a value that indicates in which direction a user navigates between pages. Inherited from WizardPageChangedEventArgs.
Page Gets or sets the current wizard page.
PrevPage Gets the previously active wizard page. Inherited from WizardPageChangedEventArgs.

#Remarks

The SelectedPageChanging event is raised when a new page is about to be selected. This occurs when an end-user clicks the Next or Back button, or the page is selected in code.

Within the SelectedPageChanging event handler you can do the following:

To learn more, see Page Events.

private void wizardControl1_SelectedPageChanging(object sender,
DevExpress.XtraWizard.WizardPageChangingEventArgs e) {
    if(e.Page == wpLongText)
        e.Page.AllowNext = ceLongText.Checked;
    if(e.PrevPage == wpQuestion && e.Direction == Direction.Forward) 
        if(ceYesAnswer.Checked) e.Page = wpProgress;
    if(e.PrevPage == wpProgress && e.Direction == Direction.Backward)
        e.Page = wpQuestion;
}
See Also