Events and event driven programming

An event is an occurrence or action which requires a response from a program. Clicking a button, positioning the cursor to an edit control, or closing down a form are all examples of events that can be trapped by the program. In KCML, subroutines known as event handlers are used to trap an event.

Each control type has its own set of available events, the simplest of these being the button control which has the Click() event. If an event handler for click exists in the program then the routine will be called each time the button is clicked with the mouse.