BGSU Logo
BGSU Home BGSU Academics BGSU Admissions The Arts BGSU Athletics Libraries Offices
Department of Computer Science
Computer Science Home Undergraduate Program Graduate Program Computer Science Faculty Academic Advising Mission and Vision
Small font Medium font Larger font Largest font
Left bracket Using Visual Basic Right bracket

The Microsoft Visual Basic compiler is available as part of Microsoft Visual Studio 2005 in all campus computer labs running Windows XP. If you'd like to own a personal copy of Visual Studio, see the instructions here.

These steps show you how to compile and execute a Visual Basic program.

  1. Start Microsoft Visual Studio 2005.
  2. Choose File | New | Project and you will see this screen:
    New Project Visual Basic
  3. Click on Visual Basic in the left pane and click on Windows Application in the right pane. Fill in the project name (Name:) and click the Browse button to select a directory for your project. Select a location on your personal hard disk or on a USB flash drive in a computer lab. A new folder will be created in that directory with the project's name. Be sure that the box labeled "Create directory for solution" is not checked. Then click OK. For this example, we assume drive E is the flash drive we are using.
  4. You will see a Solution Explorer window like the following:
    Solution Explorer
    There are two ways to open the design view of the form:
    a. click on Form1.vb and then select Designer from the View menu;
    b. right-click on Form1.vb and then select View Designer from the pop-up menu
  5. To compile your program, click Build | Build Solution.
  6. If there are error messages in the bottom window, double-click on each message to go to the location of the error in your file. Fix the errors and build your program again.
  7. Execute your program by pressing F5 or clicking Debug | Start Debugging.

Use one of the following strategies to return to your project after closing Visual Basic:

  1. double-click the solution file (which ends in extension .sln) in the project folder, or
  2. choose Open | Project/Solution from the File menu and choose the solution file (ends in .sln), or
  3. select the project from Recent Projects at the bottom of the File menu.

webmaster@cs.bgsu.edu