Results 1 to 4 of 4

Thread: disabling tabs

  1. #1

    Thread Starter
    Hyperactive Member r0k3t's Avatar
    Join Date
    Dec 2005
    Location
    Cleveland
    Posts
    361

    disabling tabs

    Hi there,

    I am trying to figure out how to disable a tab in a tabControl. I thought tab.hide() would do it but that totally has no effect. Am I missing something?

    Thanks

  2. #2
    Lively Member mikelynch's Avatar
    Join Date
    May 2006
    Location
    Goombungee Qld
    Posts
    83

    Re: disabling tabs

    try this:
    Code:
     button1.TabStop = false;

  3. #3
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: disabling tabs

    Quote Originally Posted by mikelynch
    try this:
    Code:
     button1.TabStop = false;
    A TabPage control is totally different than the "Tab" key.

    Anyway, try this code:
    Code:
                //To remove/hide a TabPage
                tabControl1.TabPages.Remove(tabPage2);
    
                //To Show the invisible TabPage again
                if ( !tabControl1.TabPages.Contains(tabPage2) )
                    tabControl1.TabPages.Add(tabPage2);
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

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

    Re: disabling tabs

    You cannot hide or disable tabs in a TabControl. You can disable a TabPage but the user can still select that tab; they just can't use any controls on it. If you want to "hide" a TabPage then you have to remove it from the TabControl. You can easily insert it back again later so it's no big deal. If you were to inherit the TabControl you could add functionality to do that internally.
    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

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