Você está na página 1de 9

Lesson 2

The Visual Basic Environment


The Toolbar
The Toolbox
The Form Designer Window
The Properties Window
The Project Explorer Window
The Form Layout Window

OBJECTIVES:
1.

Describe the Visual Basic environment

2. Identify the parts of the toolbar


3. Enumerate and explain the components of toolbox
4. Differentiate the form designer window from properties window
5. Analyze the uses of project explorer window
6. Describe a form layout window
THE VISUAL BASIC ENVIRONMENT
The environment is made up of several windows. The initial appearance of
the windows on your screen will depend on the way your environment has been
set up.

1|Page

THE TOOL BAR

The Visual Basic tool bar functions like the tool bar in any other Microsoft
application. It provides shortcuts for many of the common operating commands.
It also shows the dimensions and location of the form currently being designed.

10

11

12 13 14 15 16 17 18 19 20

1. Add standard exe project

12. Start or Run

2. Add Form

13. Break or Pause

3. Menu Editor

14. End or Stop

4. Open Project

15. Project Explorer

5. Save Project

16. Properties Window

6. Cut

17. Form Layout Window

7. Copy

18. Object Browser

8. Paste

19. Toolbox

9. Find

20. Data View Window

10. Undo

21. Visual Component Manager

11. Redo

2|Page

21

THE TOOL BOX


The tool box gives you access to the controls that you use on a form.

A control is an object such as a button, label or grid.


They are used on forms to display output or get input.

Each

control appears as a button in the tool box. If the control you are
looking for is not in the toolbox, select Components from the

Project menu.
If the tool box is not displayed on the screen, or if at any time
during the exercises you close it, choose Toolbox from the View
menu.
TOOLS IN THE VISUAL BASIC TOOLBOX

Pointer

- Selects objects

Picture box

- Draws a box to display graphics

Label

- Draws a box to display text

Text box

- Draws a box that can display text and let the user
type in text

Frame

- Groups two or more objects together

Command button - Draws a command button

Check box
3|Page

- Draws a check box

Option (or radio) button - Draws a radio button

Combo box - Draws a combo box


List box - Draws a list box

Horizontal scroll bar - Draws a horizontal scroll bar


Vertical scroll bar - Draws a vertical scroll bar

Timer - Places a timer on a form


Drive list box - Draws a drive list box that displays all the disk
drives available
Directory list box - Draws a directory list box that displays a
directory on a particular disk drive
File list box - Draws a file list box that displays files in a specific
directory
Shape - Draws a geometric shape such as a circle or a square

Line - Draws a line

Image box - Draws a box to display graphics

Data control - Draws a control to link a program to a database file

OLE - Draws a box to insert an OLE object


4|Page

THE FORM DESIGNER WINDOW


This window is where you design the forms that make up your user
interface.

If the form designer window is not displayed on the screen, or if at any time
during the exercises you close it, choose Object from the View menu.

THE PROPERTIES WINDOW


A form and each control on it, have a set of properties which control their
characteristics such as size, position and color.
The properties window lists all the properties a control has and their value.
The default value of a property can be changed by setting the property value
using the properties window when you design your application.

5|Page

If the properties window is not displayed on your screen, or if at any time during
the exercises you close it, choose Properties Window from the View menu or
simply press F4.
THE PROPERTIES WINDOW CONSISTS OF THE FOLLOWING ELEMENTS:
Object box Displays the name of the object for which you can set properties.
Click the arrow to the right of the object box to display the list of objects for the
current form.
Sort tabs Choose between an alphabetic listing of properties or a hierarchical
view divided by logical categories, such as those dealing with appearance, fonts,
or position.
Properties list The left column displays all the properties for the selected
object. You can edit and view settings in the right column.

6|Page

THE PROJECT EXPLORER WINDOW

Toggle folders
View code

Project name
Forms Folder
Form module

View object

A project is a collection of the forms and code that make up an application. Each
form in your application is represented by a file in the project explorer window.
Simply press Ctrl R if project explorer window is not available.
A form file contains both the description of the screen layout for the form and the
program code associated with it.

THE FORM LAYOUT WINDOW


Move the form in the screen in this window to set the position of your
form when your application is running.

You may wish to close the form layout window to allow more space for the
properties window. To open the window again, select Form Layout Window
from the View menu.
7|Page

PARTS OF VISUAL BASIC APPLICATION


One or more Forms

One or more controls


One or more procedures

Private Sub
CmdExit_Click()
'Stop the program
End
End Sub

8|Page

Private Sub CmdReturn_Click()


'Return to selection form
FrmFlagsCheck.Hide
FrmSelect.Show
End Sub

VISUAL BASIC OBJECTS


PROPERTIES:

EVENTS:

Forecolor
Font
Caption
Height
Width
Backcolor

Load
Mouse Down
Mouse Move
Click

METHODS:
Value
Draw Width
Backcolor
Unload me

9|Page

Você também pode gostar