Most forms are designed by adding controls to the surface of the form to define a user interface. A control is a graphical component on a form that is used to display information or accept user input. Controls can also be hidden components that provide functionality in an application.
When adding graphical controls to a form, it is important to pick the right control. For example, you can use a ListView control instead of a ListBox control to display more information when selecting from a list of options. When deciding which control to use, determine how much information the user needs to see or provide, and select a control that provides the logical way to display or retrieve the data.
To add a control to a form
The control appears in its default size at the desired location.
-or-
In the Toolbox, double-click the control to add it to the center of your form.
The control appears on your form in its default size. You can then drag it to the desired location.
After you add a control to your form, you can resize it so that it appears appropriately in the user interface.
Note Some controls, such as the ComboBox control, have absolute sizing and will not resize beyond a size specified by the control. Typically, absolute sizing applies to either the height or width of a control.
To resize a control
As you add controls to a form, you may find it easier to add a control and specify its size at the same time. You can do this by drawing the control onto the form instead of double-clicking or dragging the control onto the form.
To draw a control onto a form
The control is added to the form with the specified location and size.
Some controls are known as containers and are used to store other controls. Container controls are similar to forms in many ways. For example, controls that are added to a container control are moved when the container control is moved.
To add a control to a container
While designing a form, you can copy a control or a group of controls that you have added and set the appearance for onto a different form or another location on your current form.
To copy controls from one form to another
You can select multiple controls by holding down the CTRL key while selecting the controls.
The controls appear in the upper-left corner of the form. You can then reposition them if necessary.