Margin: Left,Top,Right,Bottom : Margin « Windows Presentation Foundation « C# / C Sharp






Margin: Left,Top,Right,Bottom

Margin: Left,Top,Right,Bottom
      

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

      <Border BorderBrush="Black" BorderThickness="1">
        <Label Margin="0,10,20,30" Background="Aqua">0,10,20,30</Label>
      </Border>

    </Canvas>

</Window>

   
    
    
    
    
    
  








Related examples in the same category

1.No marginNo margin
2.The same margin on all four sidesThe same margin on all four sides
3.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
4.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