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
  1. Home
  2. General Programming
  3. Visual Basic
  4. Modal Forms in VB 6.0

Modal Forms in VB 6.0

Scheduled Pinned Locked Moved Visual Basic
questioncom
4 Posts 3 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.
  • R Offline
    R Offline
    Red Sunday
    wrote on last edited by
    #1

    I load and show a form from the opening form of the application. We will call the startup form form a and the form that is called, form b. So a calls show form b. When form b wants to close, but not end the program, what needs to be called? Is it unload, is it deactivate? How do I get the form to close in such a way that the form a can access whatever has changed within form b? Thanks again, The VB NOOB ----------------- http://www.zachcalvert.com

    P P 2 Replies Last reply
    0
    • R Red Sunday

      I load and show a form from the opening form of the application. We will call the startup form form a and the form that is called, form b. So a calls show form b. When form b wants to close, but not end the program, what needs to be called? Is it unload, is it deactivate? How do I get the form to close in such a way that the form a can access whatever has changed within form b? Thanks again, The VB NOOB ----------------- http://www.zachcalvert.com

      P Offline
      P Offline
      pbpb
      wrote on last edited by
      #2

      You need to remember a reference to formA in formB and in Form_Unload you can call some methods by using this reference. Good method for implementing this is some kind of control, which is placed on all forms of your app.

      1 Reply Last reply
      0
      • R Red Sunday

        I load and show a form from the opening form of the application. We will call the startup form form a and the form that is called, form b. So a calls show form b. When form b wants to close, but not end the program, what needs to be called? Is it unload, is it deactivate? How do I get the form to close in such a way that the form a can access whatever has changed within form b? Thanks again, The VB NOOB ----------------- http://www.zachcalvert.com

        P Offline
        P Offline
        Purple Monk
        wrote on last edited by
        #3

        hi, I set up a dummy project, two buttons on form A and a button and a text box on form B, load form A press button 1, form B is shown, fill some text in the text box press the button on form B, form B is hidden. Then Press other button on form A to show msgbox of text in box on form B. Lovely Jubbly Form A code: Private Sub Command1_Click() Load Form2 Form2.Show End Sub Private Sub Command2_Click() MsgBox Form2.txtMsg.Text End Sub Form B Code: Private Sub Command1_Click() Form2.Hide End Sub "If i was king cigarettes would be free."

        P 1 Reply Last reply
        0
        • P Purple Monk

          hi, I set up a dummy project, two buttons on form A and a button and a text box on form B, load form A press button 1, form B is shown, fill some text in the text box press the button on form B, form B is hidden. Then Press other button on form A to show msgbox of text in box on form B. Lovely Jubbly Form A code: Private Sub Command1_Click() Load Form2 Form2.Show End Sub Private Sub Command2_Click() MsgBox Form2.txtMsg.Text End Sub Form B Code: Private Sub Command1_Click() Form2.Hide End Sub "If i was king cigarettes would be free."

          P Offline
          P Offline
          pbpb
          wrote on last edited by
          #4

          What about having two forms A (in MDI App) with different data? Which one will be called?

          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