Export (0) Print
Expand All
2 out of 2 rated this helpful - Rate this topic

Setting the showGrid Property of an HTML Document

Visual Studio .NET 2003

The showGrid property of an HTML document determines whether the positioning grid will be displayed when the document is opened for editing in Design view. The values available for this property are:

  • True (display grid)
  • False (hide grid)

Setting the showGrid property in Visual Studio .NET inserts a <META NAME=vs_showGrid> element into the <HEAD> portion of the active HTML document:

<meta name="vs_showGrid" content="True">.

For more information, see showGrid Property.

To display the Design view positioning grid and activate Snap to Grid

  1. Open a Web document for editing in Design view.
  2. Set the pageLayout property of the document to GridLayout.
  3. On the View menu, choose Toolbars and make sure Design is checked.

    The Show Grid and Snap to Grid buttons appear.

    1. To display the positioning grid, select the Show Grid button or press CTRL+G.
    2. To activate Snap to Grid, select the Snap to Grid button or press CTRL+SHIFT+G.

      The Snap to Grid feature automatically aligns elements dragged across or inserted onto the Design view surface with the nearest grid guidelines.

You can set the showGrid property either in the HTML Document Properties, Properties Window or in the General Tab, DOCUMENT Property Pages Dialog Box.

To set the showGrid property in the Properties window

  1. Open an HTML document for editing in Design view.
  2. At the top of the Properties window, choose DOCUMENT properties.
  3. Select the pageLayout property, and choose GridLayout from its drop-down list.
  4. Select the showGrid property, and choose True (display grid) or False (hide grid) from its drop-down list.

To set the showGrid property in the DOCUMENT Property Pages dialog box

  1. Open an HTML document for editing in either Design view or HTML view.
  2. At the top of the Properties window, choose DOCUMENT properties.
  3. On the View menu, select Property Pages.

    The DOCUMENT Property Pages dialog box opens.

  4. Select the General tab.
  5. Choose GridLayout from the Page Layout drop-down list.
  6. Select or clear the Show Grid check box.

To set default Show Grid and Snap to Grid settings

These settings determine whether the Show Grid and Snap to Grid features will become active by default whenever the pageLayout property of a new Web document is set to GridLayout.

Note   The positioning grid and Snap to Grid are available only in Design view.
  1. On the Tools menu, select Options.

    The Options dialog box opens.

  2. Expand the HTML Designer options and select Display.
    1. To set the default showGrid property for Web documents in Grid Layout, select or clear the Show Grid check box.
    2. To turn the Snap to Grid feature on or off by default when Web documents are in Grid Layout, select or clear the Snap to Grid check box.

See Also

Setting the pageLayout Property of an HTML Document | Properties Window | Display, HTML Designer, Options Dialog Box | Position, Style Builder Dialog Box | Positioning HTML Elements in Design View | Aligning and Layering HTML Elements in Design View | HTML Tab, Toolbox | Web Forms Tab, Toolbox

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.