DockingTab provides the functionality for the end-user to close the individual tabs in the control at runtime. For this purpose, C1DockingTab class provides the CanCloseTabs property.
A close icon can be displayed in the tabs by setting the CanCloseTabs property to true, so that the end-user can close individual tab pages.
The code snippet below shows how to close individual tab pages using CanCloseTabs.
C# |
Copy Code
|
---|---|
dockingTab.CanCloseTabs = true;
|
A close icon can also be set in the caption area by setting both the CanCloseTabs and ShowCaption property to true.
The code snippet below shows how to close individual tab pages using the close icon in the caption area:
C# |
Copy Code
|
---|---|
dockingTab.CanCloseTabs = true; dockingTab.ShowCaption = true; |
A CloseBox can also be added to each tab using the CloseBoxPositionEnum. The following table lists the different options available in the CloseBoxPositionEnum to add a Close Box to active tab page, all tab pages etc.
CloseBox options | Snapshot |
CloseBox on the active page | |
CloseBox on all pages | |
Default position of CloseBox |
The code snippet below shows how to set CloseBox on an active page:
C# |
Copy Code
|
---|---|
// Set the close box only on the active page
dockingTab.CloseBox = CloseBoxPositionEnum.ActivePage;
|