O'Reilly logo

C# Primer: A Practical Approach by Stanley B. Lippman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6.3. Implementing the Event Callback Routines

Our implementation is driven by three user-initiated events:

1.
The entry of text into the text box.
2.
The clicking of the OK button signaling that entry is complete.
3.
The clicking of the Quit button to terminate the application.

The methods we implement to respond to these events are referred to as callbacks or event handlers. There are two steps to implementing event handlers: Writing the code, of course, is the first step. The second step is registering the callback function with the control widget through which the event occurs. For our program, the three controls are the text box and the two buttons.

When we double-click on the control—for example, the text box—the designer generates the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required