Back to Devexpress

WizardControl.SelectedPageChanging Event

windowsforms-devexpress-dot-xtrawizard-dot-wizardcontrol-af92b401.md

latest3.9 KB
Original Source

WizardControl.SelectedPageChanging Event

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

Namespace : DevExpress.XtraWizard

Assembly : DevExpress.XtraWizard.v25.2.dll

NuGet Package : DevExpress.Win

Declaration

csharp
public event WizardPageChangingEventHandler SelectedPageChanging
vb
Public Event SelectedPageChanging As WizardPageChangingEventHandler

Event Data

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

PropertyDescription
CancelGets or sets whether the operation must be canceled.
DirectionGets a value that indicates in which direction a user navigates between pages. Inherited from WizardPageChangedEventArgs.
PageGets or sets the current wizard page.
PrevPageGets 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.

csharp
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

NavigationMode

WizardControl Class

WizardControl Members

DevExpress.XtraWizard Namespace