- UI 요소들을 수직, 수평으로 순서대로 나열하는 간단한 레이아웃 컨트롤로 배치가능
StackPanel의 Orientation 속성
- 기본값 : Vertical(수직)으로 Horizontal(수평)으로 변경 하능
MainPage.xaml |
[그림 9-1]
<!--2행1열로 화면(위에 DesignHeight의 크기)에 꽉차게 만듬--> <Grid x:Name="ctlLayout" Background="Red" Width="400" Height="300" ShowGridLines="True"> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <StackPanel Background="Red"> <Button Content="One" HorizontalAlignment="Left" Width="100"></Button> <Button Content="Two" HorizontalAlignment="Center" Width="100"></Button> <Button Content="Three" VerticalAlignment="Bottom" HorizontalAlignment="Right"></Button> </StackPanel> <StackPanel Background="Yellow" Orientation="Horizontal" Grid.Row="1"> <Button Content="Four" VerticalAlignment="Top" Width="100" Height="100"> </Button> <Button Content="Five" HorizontalAlignment="Center" VerticalAlignment="Stretch"></Button> <Button Content="Six" VerticalAlignment="Bottom" Width="100"></Button> </StackPanel> </Grid> |
'Silverlight' 카테고리의 다른 글
11.SilverLight3 - Layout - Border (0) | 2009.11.24 |
---|---|
10.SilverLight3 - Layout - Padding 과 Margin (0) | 2009.11.24 |
08.SilverLight3 - Layout - Grid (0) | 2009.11.24 |
07.SilverLight3 - Layout - Canvas (0) | 2009.11.24 |
06.SilverLight3 - XAML 기본 모양 살펴보기 (2) | 2009.11.24 |
Comments