Is it possible so that when you only have one tab open it won't show the tab list on top of the control. I've been trying to make the tabs hide when only one is opened and cannot seem to find a way...
Printable View
Is it possible so that when you only have one tab open it won't show the tab list on top of the control. I've been trying to make the tabs hide when only one is opened and cannot seem to find a way...
It's not possible using just the functionality provided by the TabControl. What you could do is rather than placing your controls directly on the TabPages you could place a Panel on each TabPage and then the other controls on the Panels. If there is only one TabPage you could hide the TabControl, remove the Panel from the TabPage and place it directly on the form, with the same Location and Size as the TabControl. If another TabPage is added you simply remove the Panel from the form, place it back on the TabPage and make the TabControl visible again.
Hmm good thinking. I'll have to try to do that. :)
Works like a charm, and was a lot simpler then I had expected. Thanks.
Damn.. spoke too soon. I got it to hide fine, but I can't seem to get the panel back INTO the tabcontrol.
VB Code:
pnlMain.Parent = Me tclMain.Hide()
That is all it takes to close the tabs, but what do I load as the Parent when I'm going back into the tabcontrol? I tried a few things but nothing worked.
I already told you in my previous post: the TabPage. If there's only one TabPage then it will be:VB Code:
pnlMain.Parent = tclMain.TabPages(0)
Haha oops. I was trying TabIndex(0).