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
To display the alignment submenu
Select the Alignment command from the Layout menu.
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.
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
Click the first control of your proposed group.
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
Select the Alignment command from the Layout menu and then select the Left command from the Alignment menu.
Click the Align left toolbar button.
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
Click the first control of your proposed group
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
Select the Alignment command from the Layout menu and then select the Right command from the Alignment menu.
Click the Align right toolbar button.
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
Click the first control of your proposed group
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
Select the Alignment command from the Layout menu and then select the Top command from the Alignment menu.
Click the Align top toolbar button.
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
Click the first control of your proposed group.
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
Select the Alignment command from the Layout menu and then select the Bottom command from the Alignment menu.
Click the Align bottom toolbar button.
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
Click the first control of your proposed group
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
Select the Alignment command from the Layout menu and then select the Centre Horizontally command from the Alignment menu.
Click the Centre Horizontally toolbar button.
The selected controls do not move relative to each other. If you select one control only, it centers only that control.
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
Click the first control of your proposed group
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
Select the Alignment command from the Layout menu and then select the Centre Vertically command from the Alignment menu.
Click the Centre Vertically toolbar button.
The selected controls do not move relative to each other. If you select one control only, it centers only that control.