Summary

All Windows Forms applications have at least one window in them, and each window is represented by an object whose class derives from the Form class. These classes are typically generated by the Visual Studio .NET forms designer, which uses a standard structure for handling initialization and shutdown. An application could have just one form or it might have several, but in any case, its lifetime is managed by the Application class. The controls in a form can have their layout managed automatically, and while there are several built-in styles of automatic layout, the underlying mechanisms are also exposed, allowing custom automatic layout systems to be written. Another useful feature of forms is the ability to use an extender provider—these are components which add pseudo properties (so-called extender properties) to some or all the controls on a form, allowing the basic functionality of the Control class to be augmented.

Of course, a great many Windows applications adorn their forms with menus, so in the next chapter we’ll look at how to add menus to your applications.

Get .NET Windows Forms in a Nutshell 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.