|
-
Nov 6th, 2008, 06:15 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Hiding Tabpages
Hello all.
I need to hide a few tab pages in a tab control (Visual C# 2005 Express), but keep the controls in them active.
More specifically, I have a large set of of databound labels that I have been using as 'shortcuts' in code to access the data they display. They are kept in a few seperate tab pages called "HiddenData1", "HiddenData2", etc, which are all inaccessable to the user.
This data access technique has worked quite well for me so far, but the visible "HiddenData" tabs are an aesthetic nightmare (even though they're not accessable, they're still visible). Unlike most controls, tab pages seem not to have a simple "Visible" property.
Any ideas to fix this little problem would be greatly appreciated.
Thanks,
Qu.
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
| Pong| |
Sorry for not posting more often.
-
Nov 6th, 2008, 06:20 PM
#2
PowerPoster
Re: Hiding Tabpages
hmm. is there a reason why you want to do this?
Last edited by Techno; Nov 6th, 2008 at 06:25 PM.
-
Nov 6th, 2008, 06:21 PM
#3
Thread Starter
Hyperactive Member
Re: Hiding Tabpages
That was fast. Thanks, I'll try that.
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
| Pong| |
Sorry for not posting more often.
-
Nov 6th, 2008, 06:26 PM
#4
PowerPoster
Re: Hiding Tabpages
sorry i updated my post. after checking, the hide and show methods do not seem to work... can i ask what the reason is for you doing this?
-
Nov 6th, 2008, 06:28 PM
#5
PowerPoster
Re: Hiding Tabpages
after further investigation the only way is to remove those tab pages and re-add them later on.
-
Nov 6th, 2008, 06:30 PM
#6
Thread Starter
Hyperactive Member
Re: Hiding Tabpages
Sadly, that didn't work.
The help file on Hide() says that it is equivilent to simply setting the Visible property to false, and since Tab pages don't have a Visible property, I assume that's why it didn't work...
Thanks for the suggestion, though.
Any other ideas?
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
| Pong| |
Sorry for not posting more often.
-
Nov 6th, 2008, 06:32 PM
#7
Thread Starter
Hyperactive Member
Re: Hiding Tabpages
Oh, sorry: You'd already answered. Disregard my last.
I'll try removing and re-adding, and see what effect that has on the databound labels (I mentioned those in the OP).
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
| Pong| |
Sorry for not posting more often.
-
Nov 6th, 2008, 06:39 PM
#8
Thread Starter
Hyperactive Member
Re: Hiding Tabpages
Awesome! I got it working: apparently you can still access a tab page's controls even after said tab page has been removed from it's parent tabcontrol.
Thanks for your help, Techno. Thread resolved.
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
| Pong| |
Sorry for not posting more often.
-
Nov 6th, 2008, 06:41 PM
#9
PowerPoster
Re: [RESOLVED] Hiding Tabpages
no worries, glad I could help
-
Nov 6th, 2008, 07:29 PM
#10
Thread Starter
Hyperactive Member
Re: [RESOLVED] Hiding Tabpages
Oh no, I was wrong! I got confused by the fact that the DataGridView on the hidden pages was still working, and the databound labels were working before it was hidden, but not after (meaning that the first item showed properly, but all the others didn't).
Turns out it doesn't work after all! *sigh* Oh well, I'll keep looking for a way to get it working. Thanks anyway.
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
| Pong| |
Sorry for not posting more often.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|