Skip to main content

WizardControl.CancelClick Event

Fires after the Cancel button has been clicked.

Namespace: DevExpress.XtraWizard

Assembly: DevExpress.XtraWizard.v24.2.dll

Declaration

public event CancelEventHandler CancelClick

Event Data

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

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled.

Remarks

The CancelClick event fires after the Cancel button has been clicked.

In non-modal mode, clicking the Cancel button has no effect, because no action is defined. Once clicked, the CancelClick event is raised. You should handle this event to perform the required action(s). In most instances you would close the Wizard:

private void wizardControl1_CancelClick(object sender, CancelEventArgs e) {
    this.Close();
}

The event’s e.Cancel parameter is ignored in non-modal mode.

If the XtraWizard control operates in modal mode and the WizardControl.UseCancelButton option is enabled, clicking the Cancel button always closes the modal form. To prevent the form from being closed in modal mode, set the WizardControl.UseCancelButton option to false and then cancel the CancelClick event by setting the event’s e.Cancel parameter to true:

private void wizardControl1_CancelClick(object sender, CancelEventArgs e) {
    e.Cancel = true;
}

When the XtraWizard control is closed by clicking the Cancel button, the BaseWizardPage.PageRollback event is raised for each visited wizard page.

See Also