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

In The OOP Model

This document introduces some key concepts of object-oriented programming (OOP) in Visual Basic, including objects, properties, and methods. It explains that in OOP, programs are event-driven rather than procedural, with the user able to trigger events like button clicks that cause code to run. Objects in Visual Basic include forms and controls, and have properties like name and size that describe them, as well as methods like Show and Close that perform actions. Properties and methods are accessed using object.property and object.method syntax.

Uploaded by

AmmuKutty
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

In The OOP Model

This document introduces some key concepts of object-oriented programming (OOP) in Visual Basic, including objects, properties, and methods. It explains that in OOP, programs are event-driven rather than procedural, with the user able to trigger events like button clicks that cause code to run. Objects in Visual Basic include forms and controls, and have properties like name and size that describe them, as well as methods like Show and Close that perform actions. Properties and methods are accessed using object.property and object.method syntax.

Uploaded by

AmmuKutty
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

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.

You might also like