<!--它的布局面板有五种,可以根据自己的需求不同来选择布局面板实现功能。-->
<!--第一种-->
<!--<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Row="0" Grid.Column="1" Background="Red"/>
<Button Grid.Row="0" Grid.Column="0" Background="Blue"/>
<TextBox Grid.Row="1" Grid.Column="0" Background="Wheat"/>-->
<!--第二种-->
<!--<StackPanel HorizontalAlignment="Stretch" Orientation="Horizontal">
<Button Height="100" Width="200" Background="Red"></Button>
<Button Height="100" Width="200" Background="Blue"></Button>
<Button Height="100" Width="200" Background="Beige"></Button>
<Button Height="100" Width="200" Background="Yellow"></Button>
</StackPanel>-->
<!--第三种-->
<!--<WrapPanel HorizontalAlignment="Stretch" Orientation="Horizontal">
<Button Height="100" Width="200" Background="Red"></Button>
<Button Height="100" Width="200" Background="Blue"></Button>
<Button Height="100" Width="200" Background="Beige"></Button>
<Button Height="100" Width="200" Background="Yellow"></Button>
</WrapPanel>-->
<!--第四种-->
<!--<DockPanel LastChildFill="False">
<Button DockPanel.Dock="Top" Height="100" Width="150" Background="Red"></Button>
<Button DockPanel.Dock="Right" Height="100" Width="150" Background="Blue"></Button>
<Button DockPanel.Dock="Left" Height="100" Width="150" Background="Beige"></Button>
<Button DockPanel.Dock="Bottom" Height="100" Width="150" Background="Yellow"></Button>
</DockPanel>-->
<!--第五种-->
<!--1.与Grid不同,该容器具备Columns/Rows属性,
但是设置的Columns/Rows不容许单独的进行容器大小设置。
2.位于uniformGrid中的子元素,按输入顺序排列至容器中。 -->
<!--<UniformGrid Rows=" 1" Columns="6">
<Button Height="100" Width="200" Background="Red"></Button>
<Button Height="100" Width="200" Background="Blue"></Button>
<Button Height="100" Width="200" Background="Beige"></Button>
<Button Height="100" Width="200" Background="Yellow"></Button>
<Button Height="100" Width="200" Background="Red"></Button>
<Button Height="100" Width="200" Background="Blue"></Button>
</UniformGrid>-->
WPF五种布局面板
最新推荐文章于 2024-05-07 10:01:35 发布