Tuesday, May 5, 2009

Opening Forms and Exiting in VB

If you need to open forms (and hide the old one), you can use the showDialog command to do so:
  • Me.Hide()
    newForm.showDialog()
    Me.Show()

The above code will hide the old form when the new form shows up, and show the old form again when the new form closes.

You can force the program to exit at any form using the following command:

  • Application.Exit()

No comments:

Post a Comment