Showing and Hiding Tab Items

  • 2 minutes to read

Hiding Tab Items

The DXTabControl allows individual tab items to be hidden. A hidden tab item is not disposed, and can be shown later. To hide a tab item in code, use the DXTabControl.HideTabItem method. An end-user can hide a tab item by clicking the Hide button displayed within the tab item's header, Header Area or\and Tab Panel:

TabControl_CloseButton

The visibility of the Hide button is specified by the tab control view's TabControlViewBase.HideButtonShowMode property, or individually for each tab item using the DXTabItem.AllowHide property.

Before a tab item is hidden, the DXTabControl.TabHiding event is fired, allowing you to cancel the action. To do this, set the event parameter's e.Cancel property to true. The index of the tab item that is being hidden can be obtained by the event parameter's e.TabIndex property. After the tab item has been hidden, the DXTabControl.TabHidden event is fired.

Showing Tab Items

The hidden tab items can be shown in code using the DXTabControl.ShowTabItem method. An end-user can do this using the Header Menu, which is invoked when clicking an arrow displayed in the corner of the DXTabControl. Clicking menu items shows the corresponding tab items within the DXTabControl.

TabControl_HeaderMenu_HiddenItems

Before a tab item is shown, the DXTabControl.TabShowing event is fired, allowing you to cancel the action. To do this, set the event parameter's e.Cancel property to true. The index of the tab item that is being shown can be obtained by the event parameter's e.TabIndex property. After the tab item has been shown, the DXTabControl.TabShown event is fired.