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# 4.0 Unleashed 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.