# Closing Tab Pages

Learn how to provide the end-user with the functionality to close the individual tabs in the control at runtime.

## Content



DockingTab provides the functionality for the end-user to close the individual tabs in the control at runtime. For this purpose, [C1DockingTab](/componentone/docs/win/online-command5/) class provides the [CanCloseTabs](/componentone/docs/win/online-command5/) 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.

![Application UI displaying close icon](https://cdn.mescius.io/document-site-files/images/1086a5ae-7197-4f26-942b-edb381682c69/images/canclosetabs-dockingtab.png)

The code snippet below shows how to close individual tab pages using CanCloseTabs.

```csharp
dockingTab.CanCloseTabs = true;
```

### Close Icon in Caption Area

A close icon can also be set in the caption area by setting both the CanCloseTabs and [ShowCaption](/componentone/docs/win/online-command5/) property to true.

![Application UI with the caption area showing closebox](https://cdn.mescius.io/document-site-files/images/1086a5ae-7197-4f26-942b-edb381682c69/images/caption-closebox-dockingtab.png)

The code snippet below shows how to close individual tab pages using the close icon in the caption area:

```csharp
dockingTab.CanCloseTabs = true;
dockingTab.ShowCaption = true;
```

### CloseBox Position Enumeration

A CloseBox can also be added to each tab using the [CloseBoxPositionEnum](/componentone/docs/win/online-command5/). 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 | ![Appication UI with closebox on active page.](https://cdn.mescius.io/document-site-files/images/1086a5ae-7197-4f26-942b-edb381682c69/images/closebox-activepage.png) |
| CloseBox on all pages | ![Appication UI with closebox on all pages.](https://cdn.mescius.io/document-site-files/images/1086a5ae-7197-4f26-942b-edb381682c69/images/closebox-allpages.png) |
| Default position of CloseBox | ![Appication UI with default position of closebox.](https://cdn.mescius.io/document-site-files/images/1086a5ae-7197-4f26-942b-edb381682c69/images/closebox-default.png) |

The code snippet below shows how to set CloseBox on an active page:

```csharp
// Set the close box only on the active page
dockingTab.CloseBox = CloseBoxPositionEnum.ActivePage;
```