How can I disable a tab inside a TabControl?

Total Post:110

Points:776
C# 
C#
 1298  View(s)
Ratings:
Rate this:
Is there any way to disable a tab in a tabcontrol?
  1. Post:412

    Points:2888
    Re: How can I disable a tab inside a TabControl?

    Hi Jeet,


    You could register the "Selecting" event and cancel the navigation to the tab page:

    private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
    {
        if (e.TabPage == tabPage2)
            e.Cancel = true;
    }

    Another idea is to put all the controls on the tabpage in a Panel control and disable the panel.

      Modified On Apr-04-2018 02:23:59 AM

Answer