![]() ![]() | ||
The Control class is in the System.Windows.Forms namespace. It serves as a base class for the Windows controls we'll see—such as rich text boxes—which have this class hierarchy (that is, the MarshalByRefObject class is derived from the Object class, and the Component class is derived from the MarshalByRef Object class, and so on):
Object MarshalByRefObject Component Control TextBoxBase RichTextBox
Because Windows controls are based on the Control class, they inherit many properties, methods, and events from that class, so I'll list the more interesting ones here. (Keep in mind that the Form class is also derived from Control, so it also shares these properties, methods, and events). You can find noteworthy public properties of the Control class in Table 5.1, noteworthy methods in Table 5.2, and events in Table 5.3.
I've included Tables 5.1, 5.2, and 5.3 for reference sake, and it's really worth looking through these tables, finding out, for example, what properties to use to change the background color of a control (BackColor), what method makes a control invisible (Hide), what event handles mouse button press events (MouseDown), and so on. Note that when listing the noteworthy properties, methods, and events of Windows controls in similar tables in this and the next chapters, I'm going to omit those inherited from the Control class, because there simply isn't room to list them all. You'll find all those common Control properties, methods, and events in Tables 5.1, 5.2, and 5.3.
![]() ![]() | ||