Padding(패내마외)과 Margin(좌상우하)
패내마외, 좌상우하 : Padding과 Margin
- Padding : 안쪽 여백
- Margin : 바깥쪽 여백
- 4가지 영역 설정 : 좌상우하
- Padding = "10" : 4가지 영역 모두 10픽셀 여백
- Padding = "좌,상,우,하" : 좌상우하 순으로 여백 설정
-------------------------------------------------------------------------------------
[MainPage.xaml]
<UserControl x:Class="RiaPaddingAndMargin.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="Silver">
<StackPanel Margin="30" Background="Pink">
<Button Content="버튼 1" FontSize="30" Padding="20" Margin="10"></Button>
<Button Content="버튼 2" FontSize="30" Margin="10,20,30,40" Padding="10, 20. 30, 40"></Button>
</StackPanel>
</Grid>
</UserControl>
-------------------------------------------------------------------------------------
[실행결과]