Home / Visual Basic Tutorial / Methods and events / Example Of An Event In An Application

Example Of An Event In An Application

1.Clicking the mouse.
2.Pressing a key on the keyboard.

When you click on a button it is recognized as an event by the button.

A calculator (Provided in your Windows) shown in figure is the perfect example of events and their quick responses.

For Example

Clicking on a number Button will display a particular number in the text Box.Some of events like methods require additional information in the form of arguments.

For Example,

Click event does not requires arguments whereas DragDrop event requires arguments as shown in example:

Public Sub Command1_Click()
End Sub
Public Sub Commnand1_DragDrop(Source As Control,X as Single,Y As Single)
End Sub