.NET/Silverlight&WPF
Silverlight margin 주기
피요히코~
2009. 11. 24. 22:59
EX) 버튼에 margin을 준다면
XAML에서
<Button x:Name="btn_MyBtn" Width="100" Height="100" Margin="5,5,5,5"></Button>
<Button x:Name="btn_MyBtn" Width="100" Height="100" Margin="5,5,5,5"></Button>
CS에서
Thickness thickness = new Thickness();
thickness.Left = 5;
thickness.Top = 5;
thickness.Right = 5;
thickness.Bottom = 5;
btn_MyBtn.Margin = thickness;
XAML에서의 margin순서는
CS에서와 같이
좌 상 우 하