This section describes how to select and move controls, and how to adjust controls by aligning and sizing them.
Before you can move or adjust a control, you must select it. While some operations can be applied to only one control at a time and others to a group of controls, controls can be selected both individually and as groups. You select a control by clicking on it. To make it easier to see what the mouse cursor is pointing to, the appearance of the cursor changes as it is moved around the design area. When the cursor points to a control, it becomes a selection cursor. Clicking the mouse selects the control, which is then surrounded by a box with sizing handles.
A multiple selection is a group of controls that are all selected. You make a multiple selection, for example, to align all the controls in the selection (how to align the controls is described later).
Adding to a Selection
When one control has been selected, you can add other controls to the selection by holding down the CTRL key and then selecting the other controls. As you select more controls, a box appears around the complete selection and each control in the selection is marked by a circle in the upper left corner of its own bounding box.
Another way to make a multiple selection is to use marquee selection. When the mouse cursor is in the design area but not pointing at anything, press the left mouse button and hold it down. Then drag the mouse and a rectangle appears. This is called a marquee. As the rectangle expands, any control that it overlaps, completely or partially, is selected and a circle appears in the upper left corner of its bounding box. Release the mouse button when you have selected all the controls that want. Controls can be added to the selection individually (as described earlier), and a marquee selection can be added to an existing selection by holding down the CTRL key while you carry out the marquee selection.
There is an option that determines how marquee selection works. Click Tools, and then click Options. In the Options window, the Marquee Full Selection option can be set to Yes or No. If the option is set to No, the marquee selection works as described earlier. If it is set to Yes, a control is only selected if the marquee overlaps the control completely—not just partially.
Selection and Container Controls
When you select a container control, all the controls that it contains are selected, even if they are not marked by individual bounding boxes. Be aware that a contained control can be moved so that it is only partly inside the container. However, it is considered part of the control as long as any part of it overlaps the container. To select such a control, you must click in the part that is still inside the container.
Selection and Control Branches
A control branch consists of the control itself and one or more child (subordinate) controls. An example is a text box with a label. Both are controls—the text box holding information that can change during program execution and the label holding static information (usually a caption for the text box), changeable only during form design. The label is said to be a child of the text box. When a control branch, such as a text box with a label, is selected, the control itself is displayed in a bounding box with sizing handles, as usual. The child controls that are part of the control branch are marked by a box with a circle in the upper left corner, and the whole branch is surrounded by a dotted emphasis frame. If you click the emphasis frame (the cursor changes into a selection cursor as it touches the frame), the child controls are added to the selection; this turns the selection into a multiple selection that can be moved as a whole.
When the selection cursor appears, you can move the control below it by pressing the left mouse button and holding it down while you drag the control to the desired position. The control is dropped when you release the mouse button.
Moving Selected Controls
Controls also can be moved after they have been selected. To move a selected control, move the mouse cursor toward it. When the cursor touches the border of the control, it looks like a hand. Press and hold down the left mouse button, drag the control to the desired position, and then release the mouse button. Multiple selections are moved as a whole and their relative positions within the selection are not changed.
If you created a form without using a wizard, or if you did use a wizard but rearranged some controls afterward, you may want to align the controls more precisely. There are two methods for aligning controls easily and accurately in C/SIDE:
To turn on the Snap to Grid option, click Format, and then click Snap to Grid. When you move a control it does not move smoothly, but in small, fixed increments. The dots in the design area represent some of the actual grid points that the controls snap to when they are moved. The distance between the grid points are properties (HorzGrid and VertGrid) of the form. The unit is 1/100 millimeters.
To align several controls, make a multiple selection of the controls and click Format, and then click Align. In the submenu that appears, select one of the four ways to align the controls. If, for example, the controls are in a column, you will want to align them vertically, either to the left or to the right. Select Left or Right to do this. Correspondingly, a row of controls can be top or bottom aligned. Be aware, however, if you inadvertently choose to top align a column of controls, all the controls will be placed on top of each other.
Sizing Container Controls
If you have created a container control, you can size the contained controls individually in the usual manner. The containing control—for example, the frame—can be sized like any other control. When a containing control is sized, the contained controls are not affected, that is, neither their size nor their position changes.
When you enlarge a container, any control that becomes completely overlapped by it will automatically be 'adopted' as a child that is contained by the container control. You should also be aware that you can reduce the size of a container control so that a control that it contains seems to be outside the container. However, this control is still considered to be part of the container. If no part of the control is inside the container control, it cannot be selected. You will need to enlarge the container so that all the contained controls are inside it. For more information, see.