Vb.Net Tab Control

prabhu

Member
Joined
Nov 20, 2006
Messages
5
Location
Delhi-India
Programming Experience
Beginner
Hi guys :)

I am glad to join this forum..

This is my First Post to the Forum..
Pls provide me with good solution.

I am using VB.Net 2003 ..
I am using Tab control.

Consider there are 2 tab pages

I want to hide one tab page under some occation..
I Mean user should not see the Tab page in the tab control
There should be only one tabPage on that time

I tried to make visiblity of the TabPage to false
Like
TabControl.TabPage.(TabPageName) =false
But it is not working
Pls help me out in this case
Waiting for the Reply as soon as possible
 
I'm afraid to say that the TabControls sucks big time in this department. This was an issue that was supposed to have been sorted out in .net 2.0 yet you still can't hide a tappage by regular means. The only way is to remove it from the tabcontrol and store what ever was on it elsewhere then add it to the tabcontrol again when you need it.
 
This is not exactly the solution you want but may be a suitable workaround. Faced with a similar problem, I detected the tabpage changed event and then reset selectedtabpage to the initial tabpage. It doesn't make it invisible, but it does make it impossible for the user to navigate to it until your ready.
 
I'm not exactly sure what you want your program to do, but instead of changing the visibility you could simply add or remove a tab page as needed. If you don't know the code for this I can look it up in my program.
 
I'm not exactly sure what you want your program to do, but instead of changing the visibility you could simply add or remove a tab page as needed. If you don't know the code for this I can look it up in my program.
To remove a page you can use
TabControlName.TabPages.Remove(...)
(or .RemoveAt(...), .RemoveByKey(...))

You might also want to have a look at http://homepage.ntlworld.com/mdaudi100/alternate/tabcontrols.html

The last code snippet is an implementation of a HideTab property.
 
Back
Top