HOW CAN I DISABLE A TAB INSIDE A TABCONTROL?

Jeet Verma

Total Post:110

Points:776
Posted by  Jeet Verma
C# 
C#
 1024  View(s)
Ratings:
Rate this:
Is there any way to disable a tab in a tabcontrol?
  1. Pravesh Singh

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!