1. 程式人生 > >WPF控制元件學習系列之四---WrapPanel控制元件

WPF控制元件學習系列之四---WrapPanel控制元件

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_