Types of Events
Go Up to Properties, Methods, and Events
Events that can occur can be divided into the following main types:
- User events
- System events
- Internal events
User events
User events are actions that the user initiates.
Examples of user events are:
- OnClick (the user clicked the mouse; for example Vcl.Controls.TControl.OnClick)
- OnKeyPress (the user pressed a key on the keyboard; for example, Vcl.Controls.TWinControl.OnKeyPress)
- OnDblClick (the user double-clicked a mouse button; for example, Vcl.Controls.TControl.OnDblClick)
System events
System events are events that the operating system fires for you.
For example, the OnTimer event (which the Timer component issues whenever a predefined interval has elapsed), the OnPaint event (a component or window needs to be redrawn), and so on.
Usually, system events are not directly initiated by a user action.
Internal events
Internal events are events that are generated by the objects in your application.
An example of an internal event is the OnPost event that a dataset generates when your application tells it to post the current record.