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, ...
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