[RESOLVED] Hiding a tab page in a tabcontrol
Is this the only, or correct, method for hiding a tabpage in a tabcontrol?
Hide it:
Code:
Dim RemovedTabs as List(Of TabPage)
RemovedTabs.Add(aTabPage)
aTabControl.Controls.Remove(aTabPage)
Put it back:
HTML Code:
aTabControl.Controls.Add(RemovedTabs(0))
Re: Hiding a tab page in a tabcontrol
Standard TabPages cannot be hidden in a standard TabControl. They can only be removed, which is what you're doing. I've never tried it but I believe it can be finagled with some custom code.
http://dotnetrix.co.uk/tabcontrol.htm
Re: Hiding a tab page in a tabcontrol
What I'm doing works so, if there's not a better way, I'll continue using this method.
Thanks.
Re: Hiding a tab page in a tabcontrol
Quote:
Originally Posted by
dlscott56
What I'm doing works so, if there's not a better way, I'll continue using this method.
Thanks.
The only issue could be that if you remove one tab, then remove another, then add the first back again, the tabs may then be in a different order if you don't write code to manage that. If that's not a problem then no worries.
Re: Hiding a tab page in a tabcontrol
Yep, that's a problem that has to be managed. My problem is just one tab so it's easy for now.
The solution you provided a link to is a more complete solution.