0

hi am using a tab control. in which i have already 3 tabpages. now the problm is that when the form is loaded the first tabepage must be enable while other will be disable to access untill i press the button that first tabpage is contain.
is their solution for my problem. m waiting for reply.

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by AnnieCalvert
1

You can't disable or hide tabpage in a tabcontrol only tabcontrol can be disabled. this is my problem also. my solution was remove the tabpages and add it again when i need them.

here what i did hope this may help you

private void button2_Click(object sender, EventArgs e)
        {
            if (tabControl1.TabPages.Contains(Secondtabpage))
            {
                return;
            }
            else
            {
                tabControl1.TabPages.Add(Secondtabpage);
            }
        }

when the form loads just remove the other tabs like
tabControl1.TabPages.Remove(Secondtabpage);
tabControl1.TabPages.Remove(Thirdtabpage);

so that the firsttab will be shown. use the above code to show your tabpages again.:

0

If you can use a free third party tabcontrol then take a look at
TabControlEX which does allow you to disable tabpages as well as a few other
things you can't usually do.

Edited by pritaeas: Removed self promotion link

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.