Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Using Multiple Forms

Using Multiple Forms

Scheduled Pinned Locked Moved Visual Basic
questiondesign
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MARKSHAM
    wrote on last edited by
    #1

    Up until now, I've always used a single form along with it's vb code(Form1.vb & Design). I now have a project where two forms are needed. I added a second form so now I also have (Form2.vb & Design). I want to access the 2nd form from a button on the 1st form and visa versa like a hierarchical menu system. Is it necessary to have a parent and child form relationship if I only want one of the forms accessed at any given time? Both forms will have independent vb code, but I will need to use a value created on form one in form two's vb code. I was going to hide each form that is not in focus at the time. What is the best approach for something like this?

    MSH

    C 1 Reply Last reply
    0
    • M MARKSHAM

      Up until now, I've always used a single form along with it's vb code(Form1.vb & Design). I now have a project where two forms are needed. I added a second form so now I also have (Form2.vb & Design). I want to access the 2nd form from a button on the 1st form and visa versa like a hierarchical menu system. Is it necessary to have a parent and child form relationship if I only want one of the forms accessed at any given time? Both forms will have independent vb code, but I will need to use a value created on form one in form two's vb code. I was going to hide each form that is not in focus at the time. What is the best approach for something like this?

      MSH

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      MARKSHAM wrote:

      Is it necessary to have a parent and child form relationship if I only want one of the forms accessed at any given time?

      No, the sensible thing to do here is to design both forms as user controls, put them on the one form, and switch which one is visible, at the press of a button.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      M 1 Reply Last reply
      0
      • C Christian Graus

        MARKSHAM wrote:

        Is it necessary to have a parent and child form relationship if I only want one of the forms accessed at any given time?

        No, the sensible thing to do here is to design both forms as user controls, put them on the one form, and switch which one is visible, at the press of a button.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        M Offline
        M Offline
        MARKSHAM
        wrote on last edited by
        #3

        Thanks for the suggestion. I'm new to VB and OOP so I'm going to have to look up user controls. Thanks again for leading me in the right direction.

        MSH

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups