Share via


Using Guides and Margins

Home Page (Dialog Editor)OverviewHow Do I ... Topics

Whether you are moving controls, adding controls, or rearranging a current layout, guides can help you align controls accurately within a dialog box. Guides appear as blue dotted lines across the dialog box displayed in the editor and corresponding arrows in the rulers.

When you create a dialog box, four margins are provided. Margins are modified guides, appearing as blue dotted lines.

What do you want to know more about?

Arranging controls on dialog boxes

What do you want to do?

Create and set a guide

Align controls on a guide

Disable the guides

To create and set a guide

  1. Click anywhere within the rulers to create a guide.

  2. Drag the guide into position.

    The number of DLUs is displayed in the ruler and below on the status bar. After the guide is dropped into position, hold the cursor over the guide’s arrow in the ruler to see the exact position of the guide.

Tip   To delete a guide, drag the guide out of the dialog box.

Aligning Controls on a Guide

The sizing handles of controls snap to guides when the controls are moved, and guides snap to controls (if there are no controls previously snapped to the guide). When a guide is moved, controls that are snapped to it move as well. Controls snapped to more than one guide are resized when one of the guides is moved.

The tick marks in the rulers that determine the spacing of guides and controls are defined by dialog units (DLUs). A DLU is based on the size of the dialog box font, normally 8-point MS Sans Serif. A horizontal DLU is the average width of the dialog box divided by four. A vertical DLU is the average height of the font divided by eight.

What do you want to do?

Move guides

Move margins

Size a group of controls with guides

Change the intervals of the tick marks

To move guides

  • Drag the guide to the new position.

    The coordinates of the guide are displayed in the status bar at the bottom of the window and in the ruler. Move the pointer over the arrow in the ruler to display the exact position of the guide.

To move margins

  • Drag the margin to the new position.

    To make a margin disappear, move the margin to a zero position. To bring the margin back, place the pointer over the margin’s zero position and move the margin into position.

To size a group of controls with guides

  1. Snap one side of the control (or controls) to a guide.

  2. Drag a guide to the other side of the control (or controls).

    If necessary with multiple controls, size each to snap to the second guide.

  3. Move either guide to size the control (or controls) on that side.

To change the intervals of the tick marks

  1. From the Layout menu, choose Guide Settings.

  2. In the Grid Spacing box, specify the new width and height in DLUs.

  3. Click OK.

Disabling the Guides

You can use special keys in conjunction with the mouse to disable the snapping effect of the guides. Using the ALT key disables the snapping effects of the guide selected. Moving a guide with the SHIFT key prevents snapped controls from moving with the guide.

To disable the snapping effect of the guides

  • Drag the control while holding down the ALT key.

To move guides without moving the snapped controls

  • Drag the guide while holding down the SHIFT key.

To clear all the guides

  1. Click the right mouse button in the ruler bar.

  2. From the shortcut menu, choose Clear All.

To turn off the guides

  1. From the Layout menu, choose Guide Settings.

  2. Under Layout Guides, select None.

  3. Click OK.