Tab Control Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MattGaff
    New Member
    • Oct 2007
    • 24

    Tab Control Problem

    Thought that this would be an easy thing to do but apparantly not....
    I have a tab control on my form with about 5 different tabs (pages). On one of these tabs I tried to place another tab control. Instead, the 2nd tab control overlays the entire page ranges of the 1st tab control i.e. it is not embedded into a singe tab of the 1st control.

    Does this make sense and apart from using visibility true/false for the second tab when the page is selected, is there a way to embed 1 tab control into a single page of another?
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    No, this can't be done directly. You can't place a Tab Control on a Tab Control! But you can place a Subform on the Page of a Tab Control, with the Form used as the basis of the Subform having a Tab Control on it.

    But I have to tell you that this complicated a scenario makes one think that your overall design is awfully "busy" and may need re-thinking. Exactly what are you doing here?

    Linq ;0)>

    Comment

    • OldBirdman
      Contributor
      • Mar 2007
      • 675

      #3
      Sometimes I have tab controls where most of the pages are fine, but one has too many controls to fit easily. I paste pictures of birds from several sites, and want certain identifying information. Photographer, date, location, species, common name, etc. One tab of my options tab control might be "Warn if...", and all the warning checkboxes don't fit. Checkboxes labeled "Warn if photographer name missing", "Warn if date missing", ... Easily sub-tabbed on another tab control. Here's how:
      Code:
      Private Sub tabMain_Change()
          If tabMain.Pages(tabMain.Value).Name = "Page3" Then
              tabSub.Visible = True
          Else
              tabSub.Visible = False
          End If
      End Sub
      For this example, I have TabControl = tabMain and 3 tabs, Page1, Page2, & Page3. I create another TabControl = tabSub. Yes, it appears to be on all pages of TabMain, because it isn't a part of tabMain at all. It is a control on my form, but it "Shows through" tabMain, and appears to be a control on a page (or all pages now). By making it Visible only when the proper tab page is active, it acts as if it is a sub-tab control.
      You have already done the form design. Change my tab control name to yours, and it should work.

      Comment

      • MattGaff
        New Member
        • Oct 2007
        • 24

        #4
        Cheers for the info.
        I was just wondering if it was possible but I guess not. I have gone for the tab control on a subform approach.

        The form I am using is really busy but this was the best way of dealing with what the user sees (after much thinking about the problem).

        The main form is a utilities form where users can perform many different tasks with the table data. Just on one of the tabs, they needed to see a lot of information which is best handled ny list boxes on each of the tabs.

        Comment

        Working...