0% found this document useful (0 votes)
74 views

Programming Using Microsoft Visual Basic 6.0 Lesson 1 - Get Started

This document provides instructions for developing Windows programs using Microsoft Visual Basic 6.0. It describes how to log into the computer network at Mount Druitt TAFE College, start a new Visual Basic project, and add and modify properties of forms and visual objects on the forms. The tutorial guides the reader through setting up a project, adding a label and button to a form, and changing common properties like captions, fonts, and colors.

Uploaded by

Timothy Lovett
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Programming Using Microsoft Visual Basic 6.0 Lesson 1 - Get Started

This document provides instructions for developing Windows programs using Microsoft Visual Basic 6.0. It describes how to log into the computer network at Mount Druitt TAFE College, start a new Visual Basic project, and add and modify properties of forms and visual objects on the forms. The tutorial guides the reader through setting up a project, adding a label and button to a form, and changing common properties like captions, fonts, and colors.

Uploaded by

Timothy Lovett
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Programming using Microsoft Visual Basic 6.

0
Lesson 1 - Get Started

This document describes how to develop windows programs using Microsoft Visual
Basic 6.0. This software is available in the Computer Laboratory (Room E-1-14) of
Mount Druitt TAFE . College. This tutorial will guide you through the steps of
logging in to the computer network, setting up a project and write the necessary Basic
codes for the project.

1. LOG ON THE NETWORK

a) Turn on (or restart) the computer. If you have previously used the Mount
Druitt TAFE College computer network, and are familiar with the login
procedures, then just log in as you normally do and skip ahead to Step 2.
Otherwise, follow the instructions below, which assume that you have
never logged in to your network account.
b) After going through startup procedures, a Windows NT Login dialog box
should appear on the screen. It should look like the one shown in Figure 1,
below.

Figure 1. Windows NT Login dialog box.

c) Type in the username, which is dependent on the terminal that you are
logging on. It has the format of "MDE-114B-XX" where XX is last two
digits of the network outlet number at which the computer is connected to.
In this particular example the network outlet number is "MS-E1-062" and
therefore the User Name is "MDE-114B-62". The user name is in capital
letters. The password is just "student". Notice that the password must be
in lower case characters.
d) After typing your username and password, just use the mouse to click on
the button labelled OK.
e) Now, you should be logged in to the network. If you have logged in
properly, you should see icons showing up on the screen. If you have any
questions or problems, ask your teacher before continuing.

James Kok 27/08/01 Page 1 of 6


Programming using Microsoft Visual Basic 6.0
Lesson 1 - Get Started

2. LOADING THE PROGRAMMING ENVIRONMENT OF MICROSOFT


VISUAL BASIC 6.0

a. From the Start menu of Windows, click Start, Click Programs, click
Microsoft Visual Studio Suite 6.0 and then click Microsoft Visual Basic
6.0. This will open the Programming environment for Microsoft Visual
Basic 6.0. (In addition to Visual Basic, Microsoft Visual Studio Suite also
contains compilers for Visual Studio Tools, Visual C++, Visual FoxPro
and Visual InterDev.). The IDE is the host environment in which you will
write, compile, and execute your programs. The main IDE screen should
appear similar to the one shown below, in Figure 2.

Figure 2. The IDE main screen display.

b. To start a new program, you need to create a project. To do that, select


File / New Project.
c. Click Standard.EXE and then click on the OK button.

Figure 3 : Application wizard


James Kok 27/08/01 Page 2 of 6
Programming using Microsoft Visual Basic 6.0
Lesson 1 - Get Started

The visual Basic [design] window shows up

Form

Sizing
handle

Visual Objects Properties Table

Figure 4 : Programming environment of Visual Basic 6.0

2.1 The Form

All windows programs run in pre-defined areas called windows. The window of a
program is defined by a form in visual basic.

A form can be resized by


• using the handles in the form of square dots around the form.
• Changing the width and height properties during design time
• Changing the width and height properties during run time.

(a) move the mouse pointer to one of the sizing handles press the left
button and drag to see the form change its size.
(b) Move the mouse pointer to the properties table, use the scroll bar to
scroll until you see the property height, change the height property
to another value and see how the form reacts. Then find the width

James Kok 27/08/01 Page 3 of 6


Programming using Microsoft Visual Basic 6.0
Lesson 1 - Get Started

In fact all the properties in the properties table can be changed, some properties that
you will be changing very often in the learning of programming in visual basic are
• Caption
• Backcolor
• Forecolor
• Font
• Top
• Left
• Visible
• Enabled

Change the above list of properties of the form and see the result.
You need to type in new values for some properties (like top, left,
height, widht), but for other properties you just need to click on the
cell and available options will show up (like forecolor, font, visible).
Just click on a new value for a property for a change.

Properties of a component can be changed at design-time, or during run-time.


At design-time properties can be changed by change the values in the properties
table. Properties can be changed at run-time by programming statements.

3. VISUAL OBJECTS

James Kok 27/08/01 Page 4 of 6


Programming using Microsoft Visual Basic 6.0
Lesson 1 - Get Started

Like a form, all visual objects have properties. And these properties are similar to
that of a form.

You can drop a visual object to a form by


• Click on the component that you want to drop to a form
• Move the mouse pointer to inside the form
• Press the left button and drag (means moving the mouse without
releasing the button pressed). A rectangle will show to reflect the size of
the object. Release the left button when you are satisfied with the size.

Drop a label and a button onto the form as shown in figure (a)

Figure (a)

• Click on the button called Command1. Move the mouse pointer to the
properties table and change the following properties
Caption : Change
Font : Times New Roman, Font Style : Bold Size : 14

• Click on the label called Label1. Move the mouse pointer to the properties
table and change the following properties. Resize the Label area if necessary
Caption : This is to be a message
BackColor : click the arrow in the box, click palette and then click yellow
ForeColor : Pick Blue
Font : Times New Roman, Size : 14

• Click on any area inside form1 but not on Label1 and Commandbutton1.
Move the mouse pointer to the properties table and change the following
property
Caption : My Form

Observe the changes made to the objects.


Change other properties like top, left, width, height etc..

James Kok 27/08/01 Page 5 of 6


Programming using Microsoft Visual Basic 6.0
Lesson 1 - Get Started

In this lesson you have learnt to :

• Get into the visual basic programming environment


• Start a new project for a executable program
• Locate the tool bar for visual objects
• Locate the properties table
• Understand what is a form?
• Change properties of a form during design-time
• Put visual objects onto the form and change their properties.

Changing properties of components is a significant


part of Visual basic programming

James Kok 27/08/01 Page 6 of 6

You might also like