Skip to main content
Bar

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

TabFormControlBase.PageClosing Event

Fires when a page is about to be closed, and allows you to cancel the action.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public event PageClosingEventHandler PageClosing

#Event Data

The PageClosing event's data class is DevExpress.XtraBars.PageClosingEventArgs.

#Remarks

The PageClosing event fires when a page is about to be closed using the built-in close button (see TabFormControlBase.ShowTabCloseButtons), or in code using the TabFormControlBase.ClosePage method. The Page argument allows you to determine the page being closed. Set the Cancel property to true to prevent the page from being closed.

The code snippet below shows how to prevent a particular page with a custom caption from being closed.

private void tabFormControl1_PageClosing(object sender, DevExpress.XtraBars.PageClosingEventArgs e) {
    if(e.Page.Text == "Home")
        e.Cancel = true;
}

After the PageClosing event, the TabFormControlBase.PageClosed event fires, allowing you to perform custom actions if required.

See Also