Skip to main content

DXTabControl.TabShowing Event

Occurs before a tab item is shown.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public event TabControlTabShowingEventHandler TabShowing

Event Data

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

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
Item Gets the tab item that raised the event. Inherited from TabControlCommonCancelEventArgsBase.
TabIndex Gets the index of the tab that raised the event. Inherited from TabControlCommonCancelEventArgsBase.

Remarks

Handle the TabShowing event to prevent showing a hidden tab item. To do this, set the event parameter’s TabControlTabShowingEventArgs.Cancel property to true.

To obtain the index of the tab item that is being shown, use the event parameter’s TabControlTabShownEventArgs.TabIndex property. Use the DXTabControl.GetTabItem method to obtain a tab item by its index.

After the tab item has been shown, the DXTabControl.TabShown event is fired.

To learn more, see Showing and Hiding Tab Items.

Handle the DXTabControl.SelectionChanging or DXTabControl.SelectionChanged event to cancel selecting a tab item or respond to this action respectively. For details, see Header Menu.

See Also