triplemaya
Member
- Joined
- Aug 27, 2006
- Messages
- 15
- Programming Experience
- Beginner
Hi. I have an app which puts up seven tabs in a basic window, and I need to get rid of two of them. If I delete them, I get a massive list of compile errors - I assume this is because of all of the things on that tab which no longer have a home. The obvious thing to do seems to be to hide these two tabs, but I can find no way to do this. There doesn't seem to be any property to do this with, which I would expect, coming from JAVA. I'd be very grateful if someone can tell me how to do this. I'm totally new to VB, I have been handed a project mostly finished, and I am supposed to deliver a finished product yesterday! I could wade through all the errors deleting all of the objects on these tabs, but I am concerned that this will produce further errors, and it's also going to be very sad indeed if I then need to put it all back!
I have found the post called Tabcontrol1.SelectedTab close?, and I have tried out the code, but it gives me the error "Reference to a non-shared member requires an object reference". I know I ought to know how to fix this, but I can't make it work. I have been to the microsoft reference page on this subject, where it says
Please could someone tell me what to type in.
the offending code is
Private TB as tabpage
and
TB = tabcontrol.TabPages(index of the tabpage you want to 'hide')
Tabcontrol.Tabpages.Remove(Your TabPage you want to 'hide')
I think that the tabpage I want to hide is TabControl7, that's the name in the properties box, but I'm not sure what to put in this space. When I type in TabControl7, it tells me that Name TabControl7 is not declared. Nor can I find out the index of this tabpage, unless it is 7. I am not used to working so far from the code and I'm totally lost.
also, when I type in
tabcontrol.TabPages( ...
it changes it to
Tabcontrol.TabPages( ...
which seems like it is likely to cause problems.
Please help.
I have found the post called Tabcontrol1.SelectedTab close?, and I have tried out the code, but it gives me the error "Reference to a non-shared member requires an object reference". I know I ought to know how to fix this, but I can't make it work. I have been to the microsoft reference page on this subject, where it says
- Declare the instance as an object variable.
- Reference the instance by the variable name.
Please could someone tell me what to type in.
the offending code is
Private TB as tabpage
and
TB = tabcontrol.TabPages(index of the tabpage you want to 'hide')
Tabcontrol.Tabpages.Remove(Your TabPage you want to 'hide')
I think that the tabpage I want to hide is TabControl7, that's the name in the properties box, but I'm not sure what to put in this space. When I type in TabControl7, it tells me that Name TabControl7 is not declared. Nor can I find out the index of this tabpage, unless it is 7. I am not used to working so far from the code and I'm totally lost.
also, when I type in
tabcontrol.TabPages( ...
it changes it to
Tabcontrol.TabPages( ...
which seems like it is likely to cause problems.
Please help.