tabcontrol properties not working

  • Thread starter Thread starter bytesighs
  • Start date Start date
B

bytesighs

Guest
I have a simple tab control created at design time.
I want one of the tab pages to be disabled or not visible when the application runs the becom visib;e/ enabled after a button is clicked. It doesn't seem to work. Am I doing something wrong or is this a bug?

Page load event....
tabpage6.visible=false


the visible.false doesn't seem to do anything
 
Tabs are typically arrays, not individually named as your sample code shows.

Tab(6).Visible = False

Remember that arrays start numbering with 0.
 
The way he was using would work, if you could actually do this. Tab strips are not meant to have their tabs hidden or disabled on the fly, nowhere in Windows does this. You need to re-evaluate your problem and come up with a better UI solution.
 
If somebody ever got the same problem:

I've solve it in this way...
Visual Basic:
TabControl1.TabPages.Remove(TabPage1) ' if You want this TabPage and it's button to be invisible
TabControl1.TabPages.Add(TabPage1) 'othervie use this
It's a bit complicated... look out for those tabs which are already added, and do not remove those which are removed
 
Back
Top