Chapter 12: Dialog-Based Windows Visual C++ and MFC Fundamentals
- Click an empty area on the form to deselect the controls
13.4.5..Controls Resizing................................................................................
After you have added a control to a dialog box, it assumes either its default size or the
size you drew it with. To help with the sizes of controls on the form or dialog box, Visual
C++ provides a visual grid made of black points. To can display or hide the grid by
clicking the Toggle Grid button. The dimensions of grid points are in dialog box
units (DLUs) and are set at a default value of 5. To change this spacing, display the
Guide Settings dialog box from the Layout menu and set the desired values.
To change the size of a control, first select it. Then position the mouse on one of its
handles. The mouse would assume a sizing cursor that indicates the possible type of
resizing you can apply. The mouse cursors are:
Cursor Description
Moves the seized border in the North-West <-> South-East direction^
Shrinks or heightens the control
Moves the seized border in the North-East <-> South-West direction^
Narrows or enlarges the control^
To resize a control, that is, to give it a particular width or height, position the mouse on
one of the handles and drag in the desired direction.
If the Toggle Grid button is down, in which case the dialog or form would display the
grid indicators, a control can be moved or resized only on the dotted lines. If you do not
want to follow the grid indicators, you have two alternatives. You can hide the grid
indicators by Toggle Guides button. On the other hand, you can press and hold Alt, then
click the control or one its sizing handles and drag in the desired direction.
To resize more than one control at the same time. Firs select them. Then use the
following buttons from the Dialog toolbar:
Button Name Description