StackPanel wpf 布局
GridDemo\GridDemo\MainWindow.xaml
<Window x:Class="GridDemo.MainWindow"
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"
xmlns:local="clr-namespace:GridDemo"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="800">
<StackPanel>
<Button Width="100" Height="50" Content="Button" Background="Pink" />
<Button Width="100" Height="50" Content="Button" Background="Pink" />
<Button Width="100" Height="50" Content="Button" Background="Pink" />
<Button Width="100" Height="50" Content="Button" Background="Pink" />
<Button Width="100" Height="50" Content="Button" Background="Pink" />
</StackPanel>
</Window>
<Window x:Class="GridDemo.MainWindow"
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"
xmlns:local="clr-namespace:GridDemo"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="800">
<!-- 👇 -->
<StackPanel Orientation="Horizontal">
<Button Width="100" Height="50" Content="Button" Background="Pink" />
<Button Width="100" Height="50" Content="Button" Background="Pink" />
<Button Width="100" Height="50" Content="Button" Background="Pink" />
<Button Width="100" Height="50" Content="Button" Background="Pink" />
<Button Width="100" Height="50" Content="Button" Background="Pink" />
</StackPanel>
</Window>