O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

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

8.3. Windows forms and events

Windows forms applications are event-based. This means that each user or system action, such as pressing a button, selecting an item in a list box, or repainting a window or its area causes an event. In order to intercept these events, we create event handlers – subroutines that contain pieces of code that are executed when the particular events occur. All Windows forms events are based on a feature of the common language runtime called “delegates”. We can think of delegates as type-safe, secure function pointers. For more information on events and delegates, see Chapter 3.

Each event defined in the Control class has an event delegate with a signature that looks like EventName EventHandler. For example, the Click ...

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