Using the Layout Commands

image059.png

 

The command toolbar at the top of the dialog editor contains a number of layout commands that make it easy to position and size multiple controls.

Alignment

The alignment commands (  ) let you align one or more controls with another control (known as the “master control”). Each command uses the designated edge of the master control’s rectangle to align the same edge of the other controls.

To use these commands, select all the controls you want to align except the master (either by clicking on an empty space in the dialog and dragging a selection rectangle around them, or by Shift- or Control-clicking them). Then Shift- or Control-click on the master control so that it’s the last one you select. You can distinguish the master control from the other selected controls by the color of its grips.

Once you have the controls you want aligned and the correct master control selected, click the desired alignment command.

Sizing

The sizing commands (  ) let you make one or more controls the same size as another control (known as the “master control”). You can copy either the width, height or both width and height from the master to all other selected controls.

To use these commands, select all the controls you want to resize except the master (see the Alignment section above for more detail on this process). Once you have the controls selected and the correct master chosen, click the desired resize command.

Positioning

There are two sets of positioning commands. The first (  ) is used to center one or more controls, relative to the dialog. You can center controls horizontally or vertically (if you want both you need to use both commands!). Note that when you have more than one control selected, they are repositioned as a group – that is, they maintain their relative positions to each other, and the group as a whole is centered.

The second set of positioning commands (  ) is used to space three or more controls evenly. These functions work on the group of selected controls as a whole. For example, using the Space Evenly Down command, the selected controls will be spaced evenly between the top of the top control and the bottom of the bottom control.

Grid

The Grid (  ) option displays a regular grid on the dialog, making it much easier to align controls as you place them. When the grid is turned on, controls will snap to the grid when you move or resize them using the mouse or keyboard. To override the snap-to-grid, hold the Alt key down when moving or resizing controls.

The grid size can be modified using the Grid Settings command in the Edit menu.