In the OOP model, programs are no longer procedural.
They do not follow
a sequential logic. You, as the programmer, do not take control and determine
the sequence of execution. Instead, the user can press keys and click various
buttons and boxes in a window. Each user action can cause an event to occur,
which triggers a Basic procedure that you have written. For example, the user
clicks on a button labeled Calculate. The clicking causes the buttons Click
event to occur, and the program automatically jumps to a procedure you have
written to do the calculation.
The Object Model
In Visual Basic you will work with objects, which have properties, methods,
and events. Each object is based on a class.
Objects
Think of an object as a thing, or a noun. Examples of objects are forms and controls.
Forms are the windows and dialog boxes you place on the screen; controls
are the components you place inside a form, such as text boxes, buttons, and
list boxes.
Properties
Properties tell something about or control the behavior of an object, such as its
name, color, size, or location. You can think of properties as adjectives that describe
objects.
When you refer to a property, you first name the object, add a period, and
then name the property. For example, refer to the Text property of a form called
SalesForm as SalesForm.Text (pronounced sales form dot text).
Methods
Actions associated with objects are called methods. Methods are the verbs of
object-oriented programming. Some typical methods are Close, Show, and
Clear. Each of the predefined objects has a set of methods that you can use.
You will learn to write additional methods to perform actions in your programs.
You refer to methods as Object.Method (object dot method). For example,
a Show method can apply to different objects: BillingForm.Show shows
the form object called BillingForm; ExitButton.Show shows the button object
called ExitButton.