StackPanel为容器控件,可与DockPanel进行比较,下面为常用属性示例
1.Orientation属性用法与web控件中的DatList的 RepeatDirection属性相同
2.HorizontalAlignment和VerticalAlignment
效果
(1)全局
<
StackPanel
HorizontalAlignment
="Left"
Orientation
="Vertical"
>
<
Button
>
Button One
</
Button
>
<
Button
>
Button Two
</
Button
>
<
Button
>
Button Three
</
Button
>
<
Button
>
Button Four
</
Button
>
<
Button
>
Button Five
</
Button
>
<
Button
>
Button Six
</
Button
>
</
StackPanel
>
(2)局部
<
StackPanel
Orientation
="Vertical"
>
<
Button
>
Button One
</
Button
>
<
Button
>
Button Two
</
Button
>
<
Button
>
Button Three
</
Button
>
<
Button
>
Button Four
</
Button
>
<
Button
>
Button Five
</
Button
>
<
Button
HorizontalAlignment
="Left"
>
Button Six
</
Button
>
</
StackPanel
>
结束
1.Orientation属性用法与web控件中的DatList的 RepeatDirection属性相同


2.HorizontalAlignment和VerticalAlignment


效果
(1)全局









(2)局部









结束