Wrap Panel
Introduction介绍
The wrap panel is similar to the StackPanel but it does not just stack all child elements to one row, it wraps them to new lines if no space is left. The Orientation
can be set to Horizontal
or Vertical
.
The WrapPanel can be used to arrange tabs of a tab control, menu items in a toolbar or items in an Windows
Explorer like list. The WrapPanel is often used with items of the same size, but its not a requirement.
WPF中的WrapPanel控件类似于StackPanel,但它不仅仅是对子元素停靠在一列上,如果列上的空间不足时,它还将元素进行换行处理。
可通过Orientation属性设置垂直停靠或水平停靠。
WrapPanel控件可用于排列选项卡型标签、工具栏中的菜单项或像Windows资源管理器列表项目。WrapPanel经常用到排列相同标尺的项目,但也不是必须相同的。
<WrapPanel Orientation="Horizontal"> <Button Content="Button" /> <Button Content="Button" /> <Button Content="Button" /> <Button Content="Button" /> <Button Content="Button" /> </WrapPanel> 2011-04-16
译者:gavinlove_
原文出处:http://www.wpftutorial.net/WrapPanel.html