Running the program, we see that it can detect and respond to six events:
When the user clicks on the sixth button, the computer has been programmed to clear the TextBox.
We have just given an external description of this program -- we described what it does when someone uses it. Our external description was written in English.
We could also have written it more precisely in Geek. For example, we could say:
The value "You are cute." is assigned to the text property of the textbox when the user clicks on the button that has "Cute" as the value of its text property.
The event is the user clicking on the button and the event handler assigns the new value to the text property of the textbox.
A programmer wrote the instructions telling the computer what it should do when each of these events occurs. Those sub programs are called event handlers. While event handlers may be described in English or Geek, they must be written in Visual Basic or some other programming language if the computer is to understand and execute them.
The event handlers in this example are very simple. The computer does very little when an event occurs. This is meant to be a simple teaching example, but in real programs, the event handlers can be complex sub-programs that do a lot of work. For example, when the user changes the value of a cell in a spreadsheet (an event) the event handler re-calculates and displays the entire spreadsheet.
Finally, our program handles only six events. The computer was not programmed to do anything when, for example, the user just moves the mouse over a button without clicking on it or clicks on a label. We are only concerned with events the computer has been programmed to detect and act upon.