Version

Close Buttons on Tabs

Close Buttons on Tabs

Purpose

This topic introduces the ability to place a close button on the tabs of a tabbed docked area.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

Explains how to get started with the WinDockManager component.

Close Button Locations

Overview

In previous versions, the close buttons for tabs were only available in the caption area of a pane. With the addition of the CloseButtonLocation property, the close button can also appear on the tab itself for any tabbed dock area.

Preview

The following screenshot is a preview of the close button appearing in the caption area, tabs of a tab group, and an unpinned tab.

Close Button On Tabs 1.png

CloseButton Properties

CloseButton property summary

The CloseButtonLocation property determines the display areas of the close button. The CloseButtonLocation property has been added to the GroupSettings object of the WinDockManager.

Property Name Property Type Description

CloseButtonLocation

CloseButtonLocation

A flags enum that defines the areas the close button can now render.

The following table summarizes the values of the CloseButtonLocation enum.

Property Name Description

Default

This is the default value. The CloseButtonLocation is resolved using GroupSettings on both the specified pane and the owning WinDockManager. The Default values for both these settings will resolve to Caption.

Caption

The close button appears only in the caption area.

TabGroup

The close button appears in every TabItem within the TabGroup.

TabGroupSelectedTab

The close button appears in the Selected TabItem within the TabGroup and not in the other TabItems.

AutoHide

The close button appears in the tabs created in the UnpinnedTabArea when the pane is unpinned.

AutoHideSelectedTab

The close button appears in the Selected tab in the UnpinnedTabArea when the pane is unpinned and not the other unpinned tabs within the same group.

AllTabs

The close button will appear in every available TabItem, essentially combining TabGroup and AutoHide.

AllSelectedTabs

The close button will appear in the selected TabItems within a group, essentially combining TabGroupSelectedTab and AutoHideSelectedTab.

All

The close button will appear in all possible locations.

Adding Close Button to WinDockManager

Example

The screenshot below demonstrates how the WinDockManager component with a WinTree and a WinExplorerBar docked as a TabGroup looks as a result of setting the DefaultGroupSettings.CloseButtonLocation property to All:

Property Value

DefaultGroupSettings.CloseButtonLocation

All

Close Button On Tabs 2.png

In C#:

// Set the DefaultGroupSettings.CloseButtonLocation property to All.
this.ultraDockManager1.DefaultGroupSettings.CloseButtonLocation = Infragistics.Win.UltraWinDock.CloseButtonLocation.All;
// Dock some controls as a TabGroup.
Infragistics.Win.UltraWinDock.DockAreaPane dockAreaPane = this.ultraDockManager1.DockControls(
 new Control[] { this.ultraTree1, this.ultraExplorerBar1 },
 Infragistics.Win.UltraWinDock.DockedLocation.DockedLeft,
 Infragistics.Win.UltraWinDock.ChildPaneStyle.TabGroup);

In Visual Basic:

' Set the DefaultGroupSettings.CloseButtonLocation property to All.
Me.UltraDockManager1.DefaultGroupSettings.CloseButtonLocation =
Infragistics.Win.UltraWinDock.CloseButtonLocation.All
' Dock some controls as a TabGroup.
Dim dockAreaPane As Infragistics.Win.UltraWinDock.DockAreaPane = Me.UltraDockManager1.DockControls(
 New Control() { Me.UltraTree1, Me.UltraExplorerBar1 },
Infragistics.Win.UltraWinDock.DockedLocation.DockedLeft,
Infragistics.Win.UltraWinDock.ChildPaneStyle.TabGroup)

Related Content

Topics

The following topics provide additional information related to this topic:

Topic Purpose

Contains general information related to using the WinGrid™ Column Chooser feature.