Alignment Command

Use the Alignment command from the Layout menu to access a submenu of commands that enable you to align selected groups of controls. For details, see "Alignment Controls", earlier in this chapter.

For details about aligning docking controls, see "Allowing Control Docking", earlier in this chapter and the JadeDockBar and JadeDockBase classes in Chapter 2 of the Encyclopaedia of Classes.

For details about positioning docking controls to meet your requirements when the alignContainer and alignChildren properties are set so that no automatic alignment occurs, see "Suspend Parent Alignments Command", later in this chapter.

To display the alignment submenu

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

Command Description
Left Aligns to the left edge of the master control
Right Aligns to the right edge of the master control
Top Aligns to the top edge of the master control
Bottom Aligns to the bottom edge of the master control
Centre Horizontally Centers the selected controls horizontally
Centre Vertically Centers the selected controls vertically

See also "Alignment Controls" under "Defining the Layout of Your Form", and "Examples of Laying Out Controls", earlier 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.

Left Command

Use the Left command from the Alignment menu to align a group of controls so that the left edges of the selected controls are aligned.

To select a group of controls and assign a master control

  1. Click the first control of your proposed group.

  2. While holding down the Shift key, click the other controls that are to be in your group.

The last control that you select becomes the master control.

To align the left edges of your selected group of controls, perform one of the following actions

Right Command

Use the Right command from the Alignment menu to align a group of controls so that the right edges of the selected controls are aligned.

To select a group of controls and assign a master control

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that are to be in your group

The last control that you select becomes the master control.

To align the right edges of the selected controls, perform one of the following actions

Top Command

Use the Top command from the Alignment menu to align a group of controls so that the top edges of the selected controls are aligned.

To select a group of controls and assign a master control

  1. Click the first control of your proposed group

  2. While holding down the Shift key, click the other controls that are to be in your group

The last control that you select becomes the master control.

To align the top edges of the selected controls, perform one of the following actions

Bottom Command

Use the Bottom command from the Alignment menu to align a group of controls so that the bottom edges of the selected controls are aligned.

To select a group of controls and assign a master control

  1. Click the first control of your proposed group.

  2. While holding down the Shift key, click the other controls that are to be in your group.

The last control that you select becomes the master control.

To align the bottom edges of the selected controls, perform one of the following actions

Centre Horizontally Command

Use the Centre Horizontally command from the Alignment menu to center a control or group of controls relative to the horizontal axis of your form.

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 are to be in your group

To center the selected controls horizontally, perform one of the following actions

The selected controls do not move relative to each other. If you select one control only, it centers only that control.

Centre Vertically Command

Use the Centre Vertically command from the Alignment menu to center a control or group of controls relative to the vertical axis of your form.

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 are to be in your group

To center the selected controls vertically, perform one of the following actions

The selected controls do not move relative to each other. If you select one control only, it centers only that control.