Events

Events are an important part of the Windows Forms programming model. They are used to communicate particular actions or “events” that occur during an application lifecycle. The most common example of an event is a button click. When a user clicks a button on a form an event is fired. Events can be caught (or listened to), and as a result you can specify code that is run only when a particular event occurs. The procedures that receive events are called event handlers.

The next set of examples illustrate the Event mechanism in .NET and how you can use it to develop an event-driven user interface in Windows Forms. In Windows Forms, forms and controls have a set of predefined events that can be fired and caught in your code. In the next chapter, ...

Get Visual Basic® .NET by Example 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.