1.1 The Concept of Computer Programming
1.1 The Concept of Computer Programming
If you are looking for help with your computer science essays and research papers, don't hesitate
to contact paper writing services provided by CustomWritings.com.
After installing the vb6 compiler, the icon will appear on your desktop or in your programs menu.
Click on the icon to launch the VB6 compiler. On start up, Visual Basic 6.0 will display the
following dialog box as shown in Figure 1.1.
You can choose to either start a new project, open an existing project or select a list of recently
opened programs. A project is a collection of files that make up your application. There are various
types of applications that we could create, however, we shall concentrate on creating Standard
EXE programs (EXE means executable). Before you begin, you must think of an application that
preferably have commercial, educational or recreational value. Next, click on the Standard EXE
icon to go into the actual Visual Basic 6 programming environment.
When you start a new Visual Basic 6 Standard EXE project, you will be presented with the Visual
Basic 6 Integrated Development Environment (IDE). The Visual Basic 6 Integrated Programming
Environment is shown in Figure 1.2. It consists of the toolbox, the form, the project explorer and
the properties window.
Figure 1.2: VB6 Programming Environment
The Form is the primary building block of a Visual Basic 6 application. A Visual Basic 6 application
can actually comprise many forms, but we shall focus on developing an application with one form
first. We will learn how to develop applications with multiple forms later. Before you proceed to
build the application, it is a good practice to save the project first. You can save the project by
selecting Save Project from the File menu, assign a name to your project and save it in a certain
folder. You shall now proceed to learn Visual Basic programming from the next lesson onwards.
Lesson 2: Building VB Applications
2.1 Creating Your First Application
First of all, launch Microsoft Visual Basic 6 compiler that you have installed earlier. In the New
Project Dialog , choose Standard EXE to enter Visual Basic 6 integrated development
environment. In the VB6 IDE, a default form with the name Form1 will appear. Next, double click
on Form1 to bring up the source code window for Form1, as shown in Figure 2.1.
The top of the source code window consists of a list of objects and their associated events or
procedures. In the source code window, the object displayed is Form1 and the associated
procedure is Load.
When you click on the object box, the drop-down list will display a list of objects you have inserted into your
form, as shown in figure 2.2. Here, you can see a form with the name Form1, a command button with the
name Command1, a Label with the name Label1 and a Picture Box with the name Picture1.
You do not have to worry about the beginning and the end statements (i.e. Private Sub
Form_Load.......End Sub.); Just key in the lines in between the above two statements exactly as
are shown here. When you press F5 to run the program, you will be surprised that nothing showed
up .In order to display the output of the program, you have to add the Form1.show statement like
in Example 2.1.1 or you can just use Form_Activate ( ) event procedure as shown in example
2.1.2. The command Print does not mean printing using a printer but it means displaying the
output on the computer screen. Now, press F5 or click on the run button to run the program and
you will get the output as shown in Figure 2.4.
You can also perform arithmetic calculations as shown in Example 2.1.2. VB uses * to denote the
multiplication operator and / to denote the division operator. The output is shown in Figure 2.5, where the
results are arranged vertically.