Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Disabling tab selection
posted

I need to stop users selecting a tab and instead provide buttons on each tabpage so that they can move through the tabs pages in sequence. Is there a way to disable manual selection of the tabs (for instance by clicking on them)?

  • 0
    Offline posted

    If you use tabstrip

    foreach (var tab in tabStrip.Tabs)
    {
    tab.Enabled = false;
    }


    tabStrip.SelectedTab.Enabled = true;

  • 44743
    Verified Answer
    posted

    You can hide the tabs by settings the Style of the tab control to Wizard. But if you would like the tabs visible like normal, just not 'clickable', you can handle the SelectedTabChanging and set Cancel to True. However, I believe this will also prevent your buttons from changing the select tab, so you will have to set a flag in your button click event before setting the selected tab and in the SelectedTabChanging event, only set Cancel to True if the flag is not set.