WPF布局控件之StackPanel

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>

posted @ 2012-11-09 15:16  星羽  阅读(1268)  评论(0编辑  收藏  举报