Results 1 to 7 of 7

Thread: [2005] TabControl

  1. #1

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    47

    [2005] TabControl

    Is it possible so that when you only have one tab open it won't show the tab list on top of the control. I've been trying to make the tabs hide when only one is opened and cannot seem to find a way...

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

    Re: [2005] TabControl

    It's not possible using just the functionality provided by the TabControl. What you could do is rather than placing your controls directly on the TabPages you could place a Panel on each TabPage and then the other controls on the Panels. If there is only one TabPage you could hide the TabControl, remove the Panel from the TabPage and place it directly on the form, with the same Location and Size as the TabControl. If another TabPage is added you simply remove the Panel from the form, place it back on the TabPage and make the TabControl visible again.
    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
    Member
    Join Date
    May 2006
    Posts
    47

    Re: [2005] TabControl

    Hmm good thinking. I'll have to try to do that.

  4. #4

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    47

    Re: [2005] TabControl

    Works like a charm, and was a lot simpler then I had expected. Thanks.

  5. #5

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    47

    Re: [2005] TabControl

    Damn.. spoke too soon. I got it to hide fine, but I can't seem to get the panel back INTO the tabcontrol.

    VB Code:
    1. pnlMain.Parent = Me
    2.         tclMain.Hide()

    That is all it takes to close the tabs, but what do I load as the Parent when I'm going back into the tabcontrol? I tried a few things but nothing worked.

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

    Re: [2005] TabControl

    I already told you in my previous post: the TabPage. If there's only one TabPage then it will be:
    VB Code:
    1. pnlMain.Parent = tclMain.TabPages(0)
    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

  7. #7

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    47

    Re: [2005] TabControl

    Haha oops. I was trying TabIndex(0).

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