How to Write Programs in Visual Basic

From its humble beginnings as BASIC (a teaching language at Dartmouth University), Visual Basic (VB) became one of the most popular and successful programming languages in use today. It gives anyone the ability to create Windows programs easily and quickly. Over time, Microsoft has continued to build on this programming language, and it is still very much in demand.

Instructions

    • 1

      Decided on how you are going to start and end your program. In between the starting and ending points, you need to decide what is going to happen and how it happens.

    • 2

      Download and install Visual Basic2005 Express. When you start the program, you are given a choice of project types, select "Standard EXE" and click "Open." You will now see a Form1 inside of a project window. Open the Toolbox and select a button (if you hover over the items it will show a tool tip). Draw the outline of this big button on your form by pressing the right key over the form and then releasing the mouse. If you display the property page for the button, you can change the text that is shown on the button. Visual Basic is event-driven, which means that actions are triggered by events such as clicking on the button.

    • 3

      Write code by going into the designer mode. This is done by double-clicking on the button that you just created. This will open a code window. Your lines of code go between the lines stating with Private Sub Command_Click(...) and the line "End Sub."

    • 4

      Select the Debug menu and then select "Start Debugging." This will either run your program or bring up a list of errors. If it runs, it will bring up the form you created.
      Click on your button, this will either give you an error, or do nothing (which is an error), or pop up a box with the output based on your code.

Tips & Warnings

  • To stop your program if there is an error, click on the "X" in the upper right-hand corner of the window.

Related Searches:

Comments

You May Also Like

Related Ads

Featured