Associating content to tabs via Tab Strip Control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Annie Bender
    New Member
    • Feb 2010
    • 15

    Associating content to tabs via Tab Strip Control

    Hi all, I'm making progress in the VBA learning curve, but need your help again. Application is a simple user form containing static info in several frames. No dynamic content to worry about at run time.

    Problem: Associating specific content with specific tabs on a tab strip control at design time. Seems like that should be a slam dunk, but all I can find in searches is lots of coding for dynamically changing/adding tabs programmaticall y. Surely I must be able to designate what specific content (say, a frame with its associated controls) gets associated with tab1, what content gets associated with tab2, and so on, at design time. But how? I read about the tab collection editor that sounds promising, but my properties box for the tab strip control doesn't show how to activate that editor. Is that editor not a VB6 feature?

    Simple once you know how, I'm sure, but till then, it's a mystery. Anyone? TIA

    Annie
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    Dear,

    I think you must select the "Properties " in the drop-down menu on the editor.
    (see attached picture)

    In this you can define all parameters for the tabstrip.

    I hope this will help you.


    br,
    Attached Files

    Comment

    • Annie Bender
      New Member
      • Feb 2010
      • 15

      #3
      Thanks for taking the time to reply and include screen shots, but that doesn't do what I asked about. I need to find out how to launch the tab collection editor (I guess) or some other interface that lets me associate content with a particular tab on the tab strip at design time. I don't see that even in the screen shots you posted, and it certainly isn't on my properties box for the tab strip control.

      Comment

      • vb5prgrmr
        Recognized Expert Contributor
        • Oct 2009
        • 305

        #4
        In IDE, select tab, draw frame, select other tab to make sure frame dissapears, go back and make sure it reappears. If appears on all tabs, then select frame, CTRL+X select tab, CTRL+V, repeat visible test to make sure. Same goes for pasting controls into the specific frame...



        Good Luck

        Comment

        • Annie Bender
          New Member
          • Feb 2010
          • 15

          #5
          Hi vb5prgrmr, I've tried your suggestions repeatedly without success. Selecting the tabstrip control and then pasting an existing frame on it or creating a new frame from the toolbox, either way, it doesn't get associated with one of the specific tabs on the tabstrip control. Maybe I should rephrase my original question:

          Is there a way to associate frame (and other) controls with a specific tab on the tabstrip at design time, or does the frame control (or other page content) have to be programatically coded to associate (i.e. become visible) with the intended tab only at run time? If it's the latter, perhaps a code snippet for both the form initialization sub (I'm assuming that maybe the frames that will become the page contents of the various tabs have to be assigned to an array here? What's that statement look like?) and the tabstrip_click sub (show/hide) could be suggested. Thank you so much.

          Annie

          Comment

          • Guido Geurs
            Recognized Expert Contributor
            • Oct 2009
            • 767

            #6
            Dear,


            I think there is a confusion between the components "Tabstrip" and "SSTab".

            With a TabStrip you can't place components inside the Tab pages.
            With a SStab it is possible to lock components inside like in a Picturebox or Frame.
            = see GIF 3 where the frames are always outside the Tabstrip and with a SStab its inside.

            When You select the 2e tab in the SStab: the frame id invisible.
            see GIF 4.

            see also attachment of VB6 files

            The components are in =>
            Tabstrip in: Microsoft Windows Common Controls
            SStab in: Mocrosoft Tabbed dialog control (see GIF 5)

            br,
            Attached Files

            Comment

            • vb5prgrmr
              Recognized Expert Contributor
              • Oct 2009
              • 305

              #7
              Yep, I think ggeu has that right about which control I was thinking about...

              Comment

              • Annie Bender
                New Member
                • Feb 2010
                • 15

                #8
                TabStrip vs. SSTab Control

                Thank you guys for your comments. I think part of the problem I am having is that I must have a "lite" version of VB6 (it's not stand alone, but only launches thru Excel, AFAIK) and it's missing some of the OCX files, including tabctl32.ocx and maybe some other ActiveX controls too. So, I don't have the SSTab control in my Toolbox. So a couple of other questions for the smart guys out there:

                1) Can I just download the missing OCX files (if I can find them) and register them and they'll work with my version 6.4.99.69, and will that give me the expanded toolbox that includes SSTab functionality, etc?

                2) If SSTab is so much better than TabStrip control, why would someone choose to use TabStrip anywhere or under any conditions?

                3) In case I end up having to use a TabStrip control rather than SSTab, I have coding for the TabStrip_Click( ) event that I feel pretty sure is correct, but it's not displaying the correct frame controls as I click on different tabs. I'm wondering if I am not declaring the array of frames correctly. Can someone provide a snippet showing the correct syntax for declaring an array of 2 frames please? Also, where does that declaration go? In the general declarations for the form or inside a form_load sub or even the tabstrip_click sub?

                I really want to make this tab thing work one way or the other, so I appreciate you guys helping me out.

                Annie

                Comment

                • Guido Geurs
                  Recognized Expert Contributor
                  • Oct 2009
                  • 767

                  #9
                  dear,

                  If it is VB via Excel than it is VBA !? (= Visual Basic for Applications).

                  This is an other environment than the real VB6.

                  If you are using VBA than you don't need the SSTab control because there is one standard in VBA= "Multipage" (see attached GIF).

                  A "tabstrip" is used to call frames or pictureboxes.
                  With this it is possible to place the frames where you want.
                  A "SStab" or for VBA "Multipage" has fixed pages in whitch you can place controls. see attached demo)

                  br,
                  Attached Files

                  Comment

                  • Guido Geurs
                    Recognized Expert Contributor
                    • Oct 2009
                    • 767

                    #10
                    dear,

                    If I use SSTab in VBA Excel I get an error that the Xcontrol is not save !
                    AND I can't put an other control in it !! (Even with Ctrl X - Ctrl V)

                    Attached is the GIF of the error and the OCX if You want to try it.

                    br,
                    Attached Files

                    Comment

                    • Annie Bender
                      New Member
                      • Feb 2010
                      • 15

                      #11
                      Thank you so much ggeu. Using the multipage control is so easy, and does exactly what I want. I still don't really know in what situation the tabstrip would get used, but for now, multipage has solved the problem for me. Also, it sounds like maybe I can't just download the missing OCX files and give my VBA editor the other VB6 controls, like SStab, etc. Thanks to all who offered suggestions. Annie's happy again.

                      Comment

                      Working...