Site hosted by Angelfire.com: Build your free website today!

UTORIAL 1 OVERVIEW

Lesson 1

Lesson 2
Quiz 2

Lesson 3
Quiz 3

Lesson 4
Quiz 4

Lesson 5
Quiz 5

CHECKPOINT 1

EXTRA INFO

Getting Started with VB6

GUI

Removing the form

Getting to the
Next Lesson

Code Used

Variables and Data Types

Operators

Message Box Info

 

 Object Oriented Programming (OOPs)  

There are hundreds of programming languages. The older languages such as FORTRAN, BASIC, COBOL and Pascal were procedural languages meaning that the program specified the exact sequence of all operations. Newer languages such as Java, Smalltalk and C++ are object oriented and event driven languages. Although not a true object oriented language, Visual Basic is an event driven language which has many of the elements of object-orientated programming (OOP). Each new release of the language brings it closer to being a truly object orientated language.

Visual basic works with objects that have properties and methods. Think of an abject as just that - something that it exists, a noun something tangible that you can see. In Visual Basic a 'Form' is an object and all the controls, labels, text boxes etc are also objects.

These objects have properties you may change the colour property of your form to blue. You have then changed the colour property of the form. Properties are adjectives they are 'descriptions' of objects. To refer to form1 and change the caption we would use this format - Form1.Caption="This is form one."

Actions that occur are called methods. Methods are the verbs of OOP. Some typical methods are Print, Resize, Clear and Move. We use the same format as above Form1.Resize this would resize the form.

So if you were an object your hair colour would be a property and what you are doing would be the method.

Saving Projects

Each VB project usually consists of 2 or more files. The .vbp file is a small text file that holds the names of all the other files in the project as well as information about the VB environment.

Each form in your project is saved to a file with a .frm extension. In the early stages you will use only one form but at Level 3 you will be using many linked forms. In this course you will be using modules or 'basic statement' files these are saved as .bas files.

Finally, VB adds a .vbw file to record details of all the forms. There are also .ocx files which record data of custom tools used (tools which are not used in the standard set). This file will be added if you have used these types of tools.