Results 1 to 5 of 5

Thread: [RESOLVED] Hiding a tab page in a tabcontrol

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Location
    Southeast Michigan
    Posts
    155

    Resolved [RESOLVED] Hiding a tab page in a tabcontrol

    Is this the only, or correct, method for hiding a tabpage in a tabcontrol?

    Hide it:
    Code:
    Dim RemovedTabs as List(Of TabPage)
    RemovedTabs.Add(aTabPage)
    aTabControl.Controls.Remove(aTabPage)
    Put it back:
    HTML Code:
    aTabControl.Controls.Add(RemovedTabs(0))
    Dave

    Helpful information I've found here so far : The Definitive "Passing Data Between Forms" : Restrict TextBox to only certain characters, numeric or symbolic :
    .NET Regex Syntax (scripting) : .NET Regex Language Element : .NET Regex Class : Regular-Expressions.info
    Stuff I've learned here so far : Bing and Google are your friend. Trying to help others solve their problems is a great learning experience

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Hiding a tab page in a tabcontrol

    Standard TabPages cannot be hidden in a standard TabControl. They can only be removed, which is what you're doing. I've never tried it but I believe it can be finagled with some custom code.

    http://dotnetrix.co.uk/tabcontrol.htm
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Location
    Southeast Michigan
    Posts
    155

    Re: Hiding a tab page in a tabcontrol

    What I'm doing works so, if there's not a better way, I'll continue using this method.

    Thanks.
    Dave

    Helpful information I've found here so far : The Definitive "Passing Data Between Forms" : Restrict TextBox to only certain characters, numeric or symbolic :
    .NET Regex Syntax (scripting) : .NET Regex Language Element : .NET Regex Class : Regular-Expressions.info
    Stuff I've learned here so far : Bing and Google are your friend. Trying to help others solve their problems is a great learning experience

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Hiding a tab page in a tabcontrol

    Quote Originally Posted by dlscott56 View Post
    What I'm doing works so, if there's not a better way, I'll continue using this method.

    Thanks.
    The only issue could be that if you remove one tab, then remove another, then add the first back again, the tabs may then be in a different order if you don't write code to manage that. If that's not a problem then no worries.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2010
    Location
    Southeast Michigan
    Posts
    155

    Re: Hiding a tab page in a tabcontrol

    Yep, that's a problem that has to be managed. My problem is just one tab so it's easy for now.

    The solution you provided a link to is a more complete solution.
    Dave

    Helpful information I've found here so far : The Definitive "Passing Data Between Forms" : Restrict TextBox to only certain characters, numeric or symbolic :
    .NET Regex Syntax (scripting) : .NET Regex Language Element : .NET Regex Class : Regular-Expressions.info
    Stuff I've learned here so far : Bing and Google are your friend. Trying to help others solve their problems is a great learning experience

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