How to make TabPage disabled/invisible

vnarod

Regular
Joined
Mar 22, 2002
Messages
84
How to make TabPage in TabControl disabled/invisible?

TabConltrol1.TabPages(0).Visible=False and
TabConltrol1.TabPages(0).Enabled=False

have no effect on tab "ears"
 
I don't believe you can hide or show individual tabs, as they're not actual controls. What they are is an enumeration telling the framework how to render a tabbed dialog. So, with that said, you would need to remove the tab from the enumeration altogether to hide it, and add it back in to show it.
 
But where I can store it while it is hidden? Or I have to recreate all controls on it every time I show it?
 
Thank you. That makes sense. One problem, though. When I want to add it back I have to use TabControl1.Controls.Add (t)
and it adds the page to the end. I don't see any property that will allow me to show the tab at a specific place. DO you know how to do it?
 
Visual Basic:
Me.TabControl1.Controls.Clear()
Me.TabControl1.Controls.AddRange(New System.Windows.Forms.Control() {Me.TabPage3, Me.TabPage2, Me.TabPage1})

I've yet to find a better solution.
 
Back
Top