Chapter 39. Windows Forms


  • The Form class

  • The class hierarchy of Windows Forms

  • The controls and components that are part of the System.Windows.Forms namespace

  • Menus and toolbars

  • Creating user controls

Web-based applications have taken off over the past several years and are fast becoming the standard. The ability to have all of your application logic reside on a centralized server is very appealing from an administrator's viewpoint. The downside of Web-based applications is that they typically don't provide a rich user experience. The .NET Framework has given developers the ability to create rich, smart client applications and eliminate the deployment problems and "DLL Hell" that existed before. Whether you choose to use Windows Forms or Windows Presentation Foundation (see Chapter 35, "Core WPF"), client applications are no longer difficult to develop or deploy.

Windows Forms will seem familiar if you are a Visual Basic developer. You create new forms (also known as windows or dialogs) in much the same way that you drag and drop controls from a toolbox onto the Form Designer. However, if your background is in the classic C style of Windows programming, where you create the message pump and monitor messages, or if you're an MFC programmer, you will find that you're able to get to the lower-level internals if you need to. You can override the window procedure and catch messages, but you might be surprised that you really won't need to very often.


Get Professional C# 4 and .NET 4 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.