# Restrict Specific Tabs

DockingTab lets you restrict specific tabs. Learn how to use DockingTab to restrict specific tabs.

## Content



You can add a handler to the SelectedIndexChanging event to test whether the index of the page is the page that you don't want the user to switch to. If so, e.Cancel would be set to True. For example, the following code shows how to add a handler to the [SelectedIndexChanging](/componentone/docs/win/online-command5/) event:

```csharp
private void c1DockingTab1_SelectedIndexChanging(object sender, C1.Win.Command.SelectedIndexChangingEventArgs e)
        {
            if (e.NewIndex == 1 && e.CanCancel)
                e.Cancel = true;
        }
```