Form Controls

The Windows.Forms namespace contains over a hundred different controls for creating a user interface. However, the scope of the chapter does not permit a lengthy exploration of all these controls. This chapter covers only the creation and manipulation of the mostly commonly used controls.

The Form Control

Forms act as the containers for all the controls. A control is an object placed on a form. Controls have properties, methods, and events. Properties specify the appearance of controls, and events specify the behavior of controls. Controls are generally used to display or accept information.

You add controls to a form by creating an instance of that particular control in the Form class, as shown in Listing 17.1. Forms have many ...

Get Special Edition Using C# 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.