The .NET Framework Class Library

All platform services are exposed through the .NET Framework Class Library. So whether you want to make a window appear, read a file, open a network connection, parse an XML document, or use any of the other myriad features of the platform, you will do so by using one or more classes in the class library.

The class library is divided up into namespaces . For each area of the API, there is an appropriate namespace, e.g., XML services are provided by the System.Xml namespace, GUI services are provided by the System.Windows.Forms namespace, and graphical services are provided by the System.Drawing namespace. Namespaces are hierarchical, and large namespaces are frequently subdivided into several smaller namespaces, e.g., the design-time parts of the Windows Forms API appear in the System.Windows.Forms.Design namespace.

Because the Class Library replaces large amounts of the Win32 API, and also adds new functionality not previously available, it is large and contains many namespaces. This book concentrates on the Windows Forms namespace, and the related System.Drawing namespace, although we will discuss other relevant classes as necessary.

Windows Forms and GDI+

Windows Forms is the name given to the parts of the .NET Framework Class Libraries used for building rich client applications, i.e., traditional GUI applications such as those built using the MFC before .NET. Central to Windows Forms is the Control class, the foundation of all UI applications and the subject of the next chapter. In fact, almost everything that happens in a .NET UI application revolves around controls, so most of the rest of the book is about controls.

GDI+ is the successor to Win32’s GDI—it is the API used for drawing. If a Windows Forms application wants to customize its own appearance, it must use GDI+, so this API (which lives in the System.Drawing namespace) is a fundamental part of most .NET GUI development. It provides a wide range of drawing facilities, including support for text, bitmaps, metafiles, line drawing, Bezier curves, and filled paths. It also provides advanced high-quality rendering features, such as antialiasing support for all graphical output (as opposed to just on text), and interpolation for bitmap resizing (both bilinear and bicubic).

The rest of this book is devoted to describing how to use the classes in these Windows Forms and GDI+ namespaces.

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.