堆栈面板 —布局控件 —Panel
子元素排列成一行或一列
水平 垂直
FlowDirection 子元素的流动方向
Orientation:Horizontal 一行 一般设置VerticalAlignment:Top Bottom Center Stretch
Vertical 一列 HorizontalAlignment Left Right Center Stretch
子元素超出部分,被隐藏
可以嵌套
排列一行或一列
经常嵌套在其他布局控件,与其他布局控件结合使用
<!--排列成一行或一列 StackPanel默认排列方向:垂直:宽度 水平:高度与父窗口的高度相同-->
<!--子元素超出的部分,会被隐藏-->
<!--<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<Button>按钮1</Button>
<Button Margin="10,0,10,0">按钮2</Button>
<Button>按钮3</Button>
</StackPanel>-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" FlowDirection="RightToLeft">
<Button>按钮1</Button>
<Button Margin="10,0,10,0">按钮2</Button>
<Button>按钮3</Button>
<Button>按钮1</Button>
<Button Margin="10,0,10,0">按钮2</Button>
<Button>按钮3</Button>
<Button>按钮1</Button>
<Button Margin="10,0,10,0">按钮2</Button>
<Button>按钮3</Button>
<Button>按钮1</Button>
<Button Margin="10,0,10,0">按钮2</Button>
<Button>按钮3</Button>
<Button>按钮1</Button>
<Button Margin="10,0,10,0">按钮2</Button>
<Button>按钮3</Button>
<Button>按钮1</Button>
<Button Margin="10,0,10,0">按钮2</Button>
<Button>按钮3</Button>
<Button>按钮1</Button>
<Button Margin="10,0,10,0">按钮2</Button>
<Button>按钮3</Button>
</StackPanel>