Forms and Controls

You've seen how the Form class represents a window and forms the base class for all other windows. The Control class is the base class for "components with visual representation"; it forms the base for everything you see on the screen and interact with.

You can create your own control classes by deriving from one of the control classes. You don't normally derive directly from Control itself, but from UserControl or one of the built-in controls. As you can see in Figure 10.1, UserControl adds functionality—such as scrolling— to Control, and it provides a blank control to which you can add your own user interface (UI) and functionality.

Figure 10.1: How the Control classes fit into the System.Windows.Forms namespace.

Figure 10.1: How the Control classes fit into the System.Windows.Forms namespace.

Figure 10.1 shows the overall class hierarchy in the System.Windows.Forms namespace and how the Control classes fit in.

If you want to know what each of the classes does and what functionality it provides to the hierarchy, refer to Table 9.1 in Chapter 9.

0 0

Post a comment