Tab Pages

  • Thread starter Thread starter VJ
  • Start date Start date
V

VJ

I have a Tab Control with 2 Pages, on windows form. I want to be able to
hide a tab page based on certain condition when the Form loads. I have tried
to set the Page.Visible to false, it does not work. I even tried
Page.Enabled property and set it to False..to see if the tab page is
disabled, it does not work.

I debugged the code, and the execution passes through the line were I am
trying to set the property, it goes through with no errors or exceptions..

What's happening here ?

VJ
 
Hello VJ

Its a bug in the tabcontrol. There's a work around :
Use 'Me.TabControl1.TabPages.Remove(TabPage2)' to hide it
and 'Me.TabControl1.TabPages.Add(TabPage2)' to show it
again ...

Kind Regards
Jorge Cavalheiro
 
Ok Thanks.. I just searched google groups and got the whole story on this
thing... Interesting.. Will be ok now as the pages are simple..But I can
feel for those people with complex pages and needing to have the pages in
order. Hope MS comes up with some patch soon...

VJ
 
Have you tried using the Microsoft Tabbed Dialog before
instead of the VB Tab Control? I think it works alot
better.
 
* "VJ said:
I have a Tab Control with 2 Pages, on windows form. I want to be able to
hide a tab page based on certain condition when the Form loads. I have tried
to set the Page.Visible to false, it does not work. I even tried
Page.Enabled property and set it to False..to see if the tab page is
disabled, it does not work.

You'll have to remove the tabpage from the tabcontrol's 'TabPages'
collection. The 'Hide' method and the 'Visible' and 'Enabled'
properties don't work.
 
Back
Top