Spacing Command

Use the Spacing command from the Layout menu to access a submenu of commands that enable you to neatly and logically space your controls across or down the form or container control. (For details, see "Spacing Your Controls" and "Examples of Laying Out Controls", earlier in this chapter.)

To display the Spacing submenu

The Spacing command submenu, providing the commands listed in the following table, is then displayed.

Command Description
Space Evenly Down Spaces the selected controls evenly down the container
Space Evenly Across Spaces the selected controls evenly across the container
Spread Down Container Spreads the selected controls evenly down the entire container
Spread Across Container Spreads the selected controls evenly across the entire container
Vertically Adjacent Makes the selected controls vertically adjacent
Horizontally Adjacent Makes the selected controls horizontally adjacent
Vertical Standard Spacing Automatically spaces controls vertically
Horizontal Standard Spacing Automatically spaces controls horizontally
Top/Right Command Buttons Positions command buttons at top right
Bottom/Right Command Buttons Positions command buttons at bottom right

See also "Spacing Your Controls" under "Defining the Layout of Your Form", and "Examples of Laying Out Controls", elsewhere in this chapter.

When laying out your form, use the Size subcommands before using the Alignment and Spacing layout commands, as the Size subcommands can alter the spacing of your controls.

Space Evenly Down Command

Use the Space Evenly Down command from the Spacing menu to space a group of controls so that the vertical distance between each control is the same.

The Space Evenly Down command differs from the Spread Down Container command in that it spreads the controls evenly between the highest and lowest of the controls you have selected only. The Spread Down Container command spreads the controls evenly down the whole form or container control.

To select a group of controls

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that you want in your group

Although you must select at least three controls to use this command, the order of selection is not important.

To space the controls evenly down the form or container, perform one of the following actions

Space Evenly Across Command

Use the Space Evenly Across command from the Spacing menu to space a group of controls so that the horizontal distance between each control is the same.

The Space Evenly Across command differs from the Spread Across Container command in that it spreads the controls evenly between the farthest left and farthest right of the controls you have selected only. The Spread Across Container command spaces evenly across the whole form or container control.

To select a group of controls

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that you want in your group

Although you must select at least three controls to use this command, the order of selection is not important.

To space the controls evenly across the form or container, perform one of the following actions

Spread Down Container Command

Use the Spread Down Container command from the Spacing menu to space a group of controls down a form or container control so that each control has an equal vertical space adjacent to it.

The Spread Down Container command differs from the Space Evenly Down command in that it spreads the controls evenly down the whole form or container control. The Space Evenly Down command simply spaces evenly between the highest and lowest of the controls that you have selected.

You can apply the Spread Down Container command to one control but its action is the same as the Centre Vertically command on the Alignment submenu.

To select a group of controls

  1. Click the first control of your proposed group.

  2. While holding down the Shift key, click the other controls that you want in your group.

All of the controls that you select in this way are highlighted and form your group.

To spread the controls evenly down the form or container, perform one of the following actions

Spread Across Container Command

Use the Spread Across Container command from the Spacing menu to space a group of controls across a form or container control so that the each control has an equal horizontal space adjacent to it.

The Spread Across Container command differs from the Space Evenly Across command in that it spreads the controls evenly across the whole form or container control. The Space Evenly Across command simply spaces evenly between the farthest left and farthest right of the controls that you have selected.

You can apply the Spread Across Container command to one control but its action is the same as the Centre Horizontally command on the Alignment submenu.

To select a group of controls

  1. Click the first control of your proposed group.

  2. While holding down the Shift key, click the other controls that you want in your group.

All of the controls that you select in this way are highlighted and form your group.

To spread the controls evenly across the form or container, perform one of the following actions

Vertically Adjacent Command

Use the Vertically Adjacent command from the Spacing menu to attach controls vertically. The highest control that you select does not move when the Vertically Adjacent command is actioned. All of the selected controls but the highest control are moved upward.

Controls that are in different horizontal parts of the form are moved and they become adjacent along a vertical axis.

To select this command from the Spacing menu, you must first select a group of two or more controls.

To select a group of controls

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that you want in your group

All of the controls that you select in this way are highlighted and form your group.

To make you selected controls vertically adjacent, perform one of the following actions

Horizontally Adjacent Command

Use the Horizontally Adjacent command from the Spacing menu to attach controls horizontally. The farthest left control selected does not move when the Horizontally Adjacent command is actioned. All of the selected controls but the one that is farthest left are moved to the left.

Controls that are in different vertical parts of the form are moved and they become adjacent along a horizontal axis.

To select this command from the Spacing menu, you must first select a group of two or more controls.

To select a group of controls

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that you want in your group

All of the controls that you select in this way are highlighted and form your group.

To action the Horizontally Adjacent command, perform one of the following actions

Vertical Standard Spacing Command

Use the Vertical Standard Spacing command from the Spacing menu to align selected controls vertically with standard spacing between each control.

If you have a requirement to standardize the spacing of your controls, especially button controls, use this command to standardize the spacing between controls that you want positioned vertically down your form. The default standard spacing is four dialog units.

To select a group of controls

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that you want in your group

All of the controls that you select in this way are highlighted and form your group. The first control selected becomes the master control.

To align the controls vertically with standard spacing, perform one of the following actions

Your selected group of controls is then vertically aligned with the master control and with standard space between each control.

Horizontal Standard Spacing Command

Use the Horizontal Standard Spacing command from the Spacing menu to align selected controls horizontally with standard spacing between each control.

If you have a requirement to standardize the spacing of your controls, especially button controls, use this command to standardize the spacing between controls that you want positioned horizontally across your form. The default standard spacing is four dialog units.

To select a group of controls

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that you want in your group

All of the controls that you select in this way are highlighted and form your group. The first control selected becomes the master control.

To align the controls horizontally with standard spacing, perform one of the following actions

Your selected group of controls is then aligned horizontally with the master control and with standard space between each control.

Top/Right Command Buttons Command

Use the Top/Right Command Buttons command from the Spacing menu to standardize the positioning of your command controls in the top right of your form or container.

The standard command buttons are OK, Cancel, and Help. As you would normally group these together, the Top/Right Command Buttons command enables you to standardize the position of these controls down the upper right of your form or container.

To select a group of command controls

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that you want in your group

All of the controls that you select in this way are highlighted and form your group.

To place the controls at the top right of the form or container, perform one of the following actions

Your selected controls are then stacked vertically in the upper right of the form or container. The controls are aligned with the margins and are separated from each other by the standard spacing (that is, by four dialog units).

Bottom/Right Command Buttons Command

Use the Bottom/Right Command Buttons command from the Spacing menu to standardize the positioning of your command controls in the bottom right of your form or container.

The standard command buttons are OK, Cancel, and Help. As you would normally group these together, the Bottom/Right Command Buttons command enables you to standardize the position of these controls across the lower right of your form or container.

To select a group of command controls

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that you want in your group

All the controls selected in this way are highlighted, and form your group.

To place the controls at the bottom right of the form or container, perform one of the following actions

Your selected controls are then arranged horizontally in the lower right of the form or container. The controls are aligned with the margins and are separated from each other by the standard spacing (that is, by four dialog units).