Change the margins of an object

Margins in Blend for Visual Studio 2012 determine the amount of empty space that is around an object on the artboard. For example, margins specify the amount of space between the outside edges of an object and the boundaries of a grid panel that contains the object. Or, margins specify the amount of space between objects that are contained in a stack panel.

To change the margins of an object

  1. Select the object for which you want to change the margins.

  2. Under Layout in the Properties panel, change the value (in pixels or, device-independent units which are approximately 1/96 inch) for any of the Margin properties (Top, Left, Right, or Bottom). Alternatively, you can move your mouse pointer over the margin property's text box, and then click and drag your pointer when the numerical adjust cursor 99713193-615f-4ee2-a668-522b5572f389 appears so that you can scroll through values and see the changes reflected on the artboard.

    Note

    If your object does not change in size, the Width and Height properties might set to explicit values.

    Tip

    You can also set margins for an element relative to its parent grid panel by clicking the margin (knot) adorners that appear around the object on the artboard when the object is selected and is in Grid layout. (For information about switching between canvas layout mode and grid layout mode, see Using the Grid layout panel.)

    If a margin adorner is open, vertically dac083fe-54cd-4cdc-973a-bea351080175 or horizontally 7eeec52f-8610-416e-a0f2-79c7bf117e77, that margin is not set.

    If a margin adorner is closed, vertically 8523b4c7-be0f-4624-961a-6adb66120049 or horizontally 95a79778-cb78-400c-9f4f-5f6fc5a02eb1, that margin is set.

    Resizing the grid panel during run time will leave any objects in place where the margins aren't set. Objects that are bound to a margin will move with the margin as the grid panel is resized.