How to: Set Margins for a Control in the WPF Designer
Margins represent the amount of fixed space between the edge of a control and the edge of a window. You can easily set or release margins for a control in the WPF Designer for Visual Studio.
To set or release margins on the design surface
Drag a control to its desired location on a window. Note that on each side of the control there are either lines or stubs. The lines stretch from the edge of the control to the corresponding edge of the container.
To set a margin, move over a stub until the pointer changes to a pointing finger.
Click the stub. The stub expands to form a margin line and the margin is set.
To release a margin, move over a line until the pointer changes to a pointing finger.
Click the margin line. The line contracts to a stub and the margin for that side is released.
To set margins in the Properties window
Select or add a control on the window.
In the Properties window, find the Margin property.
In the right column, click the drop-down arrow to display the margin editor. The following illustration shows the margin editor.
Use the visual aids provided by the margin editor to set the desired margins.
See Also
Tasks
How to: Set Margins of Elements and Controls
Concepts
Change History
Date |
History |
Reason |
---|---|---|
March 2011 |
Added information about margin editor. |
Information enhancement. |