Share via


Aligning Controls in Forms

The buttons on the Layout toolbar make it easy to accurately line up controls in relation to each other in your forms. For example, you might want to align controls horizontally or vertically or make sure that a related set of controls has the same width or height. To align controls, select a group of controls, and then choose one of the layout buttons on the Layout toolbar.

Adjusting Control Placement

If you need to place controls precisely on the screen, you can use Show Position on the View menu. When checked, Show Position displays the coordinates and dimensions of a selected control in the status bar at the bottom of the Form Designer window.

Controlling the Grid Display

The grid display helps you align controls on your forms. You can adjust the size of the grid with Set Grid Scale on the Format menu. You can turn display of the grid on and off by using the Grid Lines command on the View menu, or setting the Grid Lines option on the Forms tab of the Options dialog box.

You can also adjust the size or position of controls in relation to the grid with Snap to Grid on the Format menu. When Snap to Grid is checked on the Form menu, controls placed on a Form are automatically aligned to the guidelines on the grid. You can override the grid by:

  • Clearing Snap to Grid on the Format menu. By default, this option is checked.

  • Using the arrow keys to align controls.

  • Pressing CTRL before clicking on a control and holding the CTRL key down while dragging the object to another position.

  • Choosing alignment options from the Layout toolbar or the Format menu.

See Also

Tasks

How to: Add Visual FoxPro Containers

How to: Add User-Defined Objects to a Form

How to: Add Properties and Methods to a Form

How to: Add Visual FoxPro Controls to a Form

How to: Add Controls to a Wizard-Generated Form

How to: Add User-Defined Objects to a Form

How to: Select, Move, and Resize Form Controls

How to: Set Tab Order for Controls

Concepts

Adding Objects to Forms

Reference

Aligning Controls in Forms

Other Resources

Creating Forms