The Visual Basic Development Environment Contains These Programming Tools and Windows, With Which You Construct Your Visual Basic Programs
The Visual Basic Development Environment Contains These Programming Tools and Windows, With Which You Construct Your Visual Basic Programs
Menu bar
Toolbars
Visual Basic toolbox
Form window
Properties window
Project Explorer
Immediate window
Form Layout window
The exact size and shape of the windows depends on how your system has been
configured. In Visual Basic 6.0, you can align and attach (dock) the windows to make all the
elements of the programming system visible and accessible. You’ll learn how to customize your
development environment in Moving, Docking, and Resizing Windows.
Before you can work with a Visual Basic program, you need to load the program into memory,
just as you would load a word processing document in a word processor for editing.
1. On the File menu, click Open Project. The Open Project dialog box appears. With
this dialog box, you can open any existing Visual Basic program on your hard disk,
attached network drive, CD-ROM, or floppy disk.
2. If necessary, use the Look In drop-down list box and the Up One Level button to
locate the program you want to load. Then, double-click the program name. The project
file loads the Visual Basic user interface form, properties, and program code. (Visual
Basic project files are distinguished by the .VBP file name extension.)
3. If the program user interface does not appear, open the Forms folder in the
Project window, select the first form, and then click View Object in the Project window.
This is an optional but useful step, especially if you want to look at the program user
interface in the Form window before you run it.
4. On the Visual Basic Standard toolbar, click Start to run the program. The toolbox
and several of the other windows disappear, and the Visual Basic program starts to run.
5. On the toolbar, click End when you want to exit the program.
See below to view an illustration of the standard contents of the toolbox.
Form Window
When you start Visual Basic, a default form (Form1) with a standard grid (a window consisting
of regularly spaced dots) appears in a pane called the Form window. You can use the Form
window grid to create the user interface and to line up interface elements.
Properties Window
With the Properties window, you change the characteristics (property settings) of the user
interface elements on a form. A property setting is a characteristic of a user interface object. For
example, you can change the text displayed by a text box control to a different font, point size,
or alignment. (With Visual Basic, you can display text in any font installed on your system, just
as you can in Microsoft Excel or Microsoft Word.)
Project Window
A Visual Basic program consists of several files that are linked together to make the program
run. The Visual Basic 6.0 development environment includes a Project window to help you
switch back and forth between these components as you work on a project.
Note: In Visual Basic versions 1 through 3, project files had the .mak file name extension. In
Visual Basic versions 4, 5, and 6.0, project files have the .vbp file name extension.
Adding Projects
If you load additional projects into Visual Basic with the File menu Add Project command,
outlining symbols appear in the Project window to help you organize and switch between
projects.
Code Window
You can create much of your program by using controls and setting properties. However, most
Visual Basic programs require additional program code that acts as the brains behind the user
interface that you create. This computing logic is created using program statements —
keywords, identifiers, and arguments — that clearly spell out what the program should do each
step of the way.
You enter program statements in the Code window, a special text editing window designed
specifically for Visual Basic program code. You can display the Code window in either of two
ways:
The Form Layout window is a visual design tool. With it, you can control the placement of the
forms in the Windows environment when they are executed. When you have more than one
form in your program, the Form Layout window is especially useful — you can arrange the
forms onscreen exactly the way you want.
To position a form in the Form Layout window, simply drag the miniature form to the desired
location in the window.