How to add a form to tab control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sasie7679
    New Member
    • Dec 2006
    • 17

    How to add a form to tab control

    Dear all,

    Could somebody tell me how to add a vb form to a tab control (VB 6.0)? I have some 5 forms and i would like to add each form to the tab control.

    Regards,
    Sasie
  • alkeshnayak
    New Member
    • Jul 2008
    • 5

    #2
    May Be You Can Not Add Form in Tab Control But You Can Trt A Tab Control and Put Your All Form's Control In Tabular Format

    Comment

    • Sasie7679
      New Member
      • Dec 2006
      • 17

      #3
      I just gave an example of 5 forms. But in our live application we have around 50 forms. We have a new requirement to display all forms in a tab control. It would be time consuming to select all controls of each form and place them in the tab control. I tried using setParent API and it works fine, but some times the form position changes. I would like to know whether any other work around is there.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by Sasie7679
        Dear all,

        Could somebody tell me how to add a vb form to a tab control (VB 6.0)? I have some 5 forms and i would like to add each form to the tab control.

        Regards,
        Sasie
        That is not possible because form is the parent control and container for all other controls.

        You need to use MDI for that.

        Comment

        • !NoItAll
          Contributor
          • May 2006
          • 297

          #5
          You can select all of the controls of a form then cut and paste them. Sometimes the arrangement is a little off, but correcting that only takes a few seconds.
          So - you are going to wind up with some 50 tabs here, made from a 50 form application? Wow - this sounds like an app written by Beelzebub himself!

          Comment

          • smartchap
            New Member
            • Dec 2007
            • 236

            #6
            Dear sasie7679

            First of all design all your forms separately. Now say ur forms are named form1, form2,...,etc. Place a tab control in a separate form which will be ur main form. Now on click event of tabs write code to load & show the corresponding form (form1 or form 2 or any other form) in that tab (by using index of that tab). Also align the form's left and right as per tab size.

            Comment

            Working...