Application Development Using Visual Basic® and .NET
by Robert J. Oberg, Peter Thorsteinson, Dana L. Wyatt
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access