• home
  • forum
  • my
  • kt
  • download
  • How to Open a New Form with the Press of a Button

    Author: 2007-09-05 14:00:29 From:

    How to Open a New Form with the Press of a Button

    Having a program with everything on one form would be extremely cluttered, that is why most programs are split into many different forms and windows. This is a very basic tutorial on how to open a new form/window by simply clicking on a button. As always, I¡¯d reccommend trying to mess around with the various settings you have available to you. Tutorials should be used as learning tools, not just a quick fix.

    1. Launch Visual Basic 2005 Express
    2. Go to File ¨¤ New Project
    3. Press OK
    4. In the Toolbox (it should be on the left of the screen) double click on the Button control
    5. A button will appear in your form, you can resize it, and move it as you please.
    6. Go to Project ¨¤ Add Windows Form
    7. Then click on Add
    8. Go back to the original form (Form1.vb)
    9. Double click on the Button ¨C a code Window will appear.
    10. Type in, just before the End Sub: Form2.Show()
      Basically, all you are doing is typing the name of the form, and putting .Show() after it.
    11. Now you can Start Debugging to test the program ¨C no errors should occur, as it is a very simple program.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      .NET (8)
      Buttons (3)
      Database Related (7)
      Date and Time (1)
      Development (3)
      Error Handling (2)
      File Manipulation (5)
      Introduction to Visual Basic (9)
      Miscellaneous (2)
      Multimedia (9)
      Networking (9)
      Security (1)
      VB Script (6)

    New

    Hot