You can't just hide and show tabs in a tabcontrol - it was never meant to operate that way. Nor can you disable individual tabs. The best you can do is to remove them all and add the ones you need, or to not show some in the first place.
Neither Hide() nor setting Visible=False will work with TabPages. You can remove them through the TabControl's Controls collection or the TabPages collection using the Remove method.
For example, use one of the two lines below (they do the same thing):
C#:
tabControl1.TabPages.Remove(tabPage2);
// OR
tabControl1.Controls.Remove(tabPage2);
Keep in mind that if you want to add the tabpages back in later, you have to add them in the order you want them. That may mean removing them all and adding them back in one at a time.
Make a procedure like:
exposeContrls(Page as control)
to expose the controls dynamically with page.controls.add...etc..
then you can remove and add any tabpage and load its interface.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.