Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
This chapter is from the book


The base object for all other objects in the .NET Framework is, appropriately titled, the Object object. Because it is so generic, it is used in several places where a specialized object is either not needed or unable to be determined. Object has five methods—Equals, ReferenceEquals, GetHashCode, GetType, and ToString—that all other .NET objects inherit.

The System.Windows.Forms.Form object, derived indirectly from Object, is typically the main piece of your Windows Forms applications. It provides the frame and background for other user interface pieces, and it provides a lot of functionality by itself.

The Form object has 101 properties that enable you to control nearly every single visual aspect of the UI. You can make your form transparent with the Opacity property, make it non-resizable with the FormBorderStyle property, and control how the user can interact with the form by modifying the MaximizeBox, MinimizeBox, HelpButton, ControlBox, or SizeGripStyle properties.

Additionally, Form has many methods, such as BringToFront and Focus, that you can execute to control the display.

Finally, you learned about events and the message loop, which enables an application to sit idly by until a user provides some input. The Form object has events that fire for many user actions, including mouse clicks, key presses, and dragging-and-dropping.

Tomorrow you'll learn to enhance your Windows Forms by adding menus and toolbars—standard features on almost every commercial application—to your applications. Then in Day 5, you'll examine events in more detail, and make your menus and toolbars functional!

  • + Share This
  • 🔖 Save To Your Account