Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Gurus*
Posted
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.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

  • 4 weeks later...
  • *Experts*
Posted

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):

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.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

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.

Auto-suggestion: "I have a life"

Uncontroled thinking: "So what the.."

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...