Events in UI Frameworks

While we’re at it, I want to emphasize the event-driven nature of UI frameworks. In the preceding example, we’ve subscribed to a single event (that is, the Load event of the form itself). We did so through the Windows Forms designer by double-clicking an empty region of the form, leaving all the boilerplate code being generated to the tools. Let’s take a peek at how this is achieved precisely.

First, let’s go after the place where events are declared in the Windows Forms designer. In Figure 18.23, spot the lightning bolt icon in the Properties window’s toolbar. In fact, the control shown here in Visual Studio 2010 is the same PropertyGrid control as the one we’re using inside our application, but with a few additional ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.