The same margin on all four sides : Margin « Windows Presentation Foundation « C# / CSharp Tutorial






<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  Title="About WPF" 
  Background="OrangeRed">

    <Canvas>


  <Border BorderBrush="Black" BorderThickness="1">

    <Label Margin="10" Background="Aqua">10</Label>
  </Border>
    </Canvas>

</Window>
WPF The Same Margin On All Four Sides








24.60.Margin
24.60.1.No marginNo margin
24.60.2.The same margin on all four sidesThe same margin on all four sides
24.60.3.Margin: Left,Top,Right,BottomMargin: Left,Top,Right,Bottom
24.60.4.Set margins, by changing any existing property value for the margin in code-behind with Thickness classSet margins, by changing any existing property value for the margin in code-behind with Thickness class
24.60.5.Change the margins of an element that is within a Grid by XAML and programmatic codeChange the margins of an element that is within a Grid by XAML and programmatic code