Windows Forms Event Handling

GUI applications are event-driven, that is, the application executes code in response to user events, such as clicking the mouse, choosing a menu item, and so on. Each form or control has a predefined set of events. For example, every form has a MouseDown event and every control has a Click event.

Windows Forms employs the .NET event model,[1] which uses delegates to bind events to the methods that handle them. The Windows Forms classes use multicast delegates. A multicast delegate maintains a list of the methods it is bound to. When an event occurs in an application, the control raises the event by calling the delegate for that event. The delegate then calls all the methods it is bound to. However, VB.NET hides most ...

Get Application Development Using Visual Basic® and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.