Professional Documents
Culture Documents
Net
What is Object?
An object is a set/collection of properties and methods.
OR
Object is an instance of a class and it is characterized by state, behavior, and identity.
Properties
An object may have different properties associated with it. The properties can be
accessed as follows:
objectName.propertyName
Suppose we have an object Student with some properties such as Name, Marks and Gender.
These properties can be accessed as follows:
Student.Name =”Umer”
Student.Marks=100
Student.Gender=”Male”
Methods
Methods are used to perform actions. Objects have different types of methods. Some
methods are used to set or get the values of different properties of objects. These methods can
be accessed as follows:
objectName.methodName
Suppose we have an object Student with some methods such as show, close and Gender.
These properties can be accessed as follows:
Student.show()
Student.close()
What is Event?
An event occurs when something happens or an action is performed.
OR
An action or occurrence detected by a program. Events can be user actions, such
as clicking a mouse button or pressing a key, or system occurrences, such as running out
of memory. Most modern applications, particularly those that run in Macintosh and Windows
environments, are said to be event-driven, because they are designed to respond to events.
What is Event Handlers?
An event handler is a piece of code that is executed when an event occurs. Each event handler
is associated with an event.
Events Triggered By The Mouse
Mouse is the most common event of the mouse. The events
triggered by the mouse are called mouse events. These are the most common events in Visual
Basic. Following are the mouse events available in most objects.
Click Event
The click event occurs when the user interact with the object by pressing the left mouse button.