Results 1 to 10 of 10

Thread: [RESOLVED] Hiding Tabpages

  1. #1

    Thread Starter
    Hyperactive Member Quasar6's Avatar
    Join Date
    Mar 2008
    Location
    Sol 3
    Posts
    325

    Resolved [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.

  2. #2
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    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.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  3. #3

    Thread Starter
    Hyperactive Member Quasar6's Avatar
    Join Date
    Mar 2008
    Location
    Sol 3
    Posts
    325

    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.

  4. #4
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    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?

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  5. #5
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: Hiding Tabpages

    after further investigation the only way is to remove those tab pages and re-add them later on.

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  6. #6

    Thread Starter
    Hyperactive Member Quasar6's Avatar
    Join Date
    Mar 2008
    Location
    Sol 3
    Posts
    325

    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.

  7. #7

    Thread Starter
    Hyperactive Member Quasar6's Avatar
    Join Date
    Mar 2008
    Location
    Sol 3
    Posts
    325

    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.

  8. #8

    Thread Starter
    Hyperactive Member Quasar6's Avatar
    Join Date
    Mar 2008
    Location
    Sol 3
    Posts
    325

    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.

  9. #9
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Re: [RESOLVED] Hiding Tabpages

    no worries, glad I could help

    MVP 2007-2010 any chance of a regain?
    Professional Software Developer and Infrastructure Engineer.

  10. #10

    Thread Starter
    Hyperactive Member Quasar6's Avatar
    Join Date
    Mar 2008
    Location
    Sol 3
    Posts
    325

    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
  •  



Click Here to Expand Forum to Full Width