Programming Using Microsoft Visual Basic 6.0 Lesson 1 - Get Started
Programming Using Microsoft Visual Basic 6.0 Lesson 1 - Get Started
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.
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.
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.
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.
Form
Sizing
handle
All windows programs run in pre-defined areas called windows. The window of a
program is defined by a form in visual basic.
(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
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.
3. VISUAL OBJECTS
Like a form, all visual objects have properties. And these properties are similar to
that of a form.
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