WrapPanel 和 DockPanel

來源:互聯網
上載者:User

標籤:是什麼   屬性   margin   技術分享   grid   簡單的   bsp   方向   .com   

WrapPanel 和 DockPanel 兩個是比較簡單的版面配置容器. 這兩個控制項將彌補 StackPanel 的某些不足
  WrapPanel 控制項:
    該控制項一句 Orientation 屬性, 在垂直堆放控制項或者行中放置控制項方面, WrapPanel
    於 StackPanel 類似. 除了堆疊放外, WrapPanel 還包含的控制項提供了換行支援. 如果在
    WrapPanel 控制項提供的內容寬度超過了容器,就會自動換行.
  DockPanel 控制項:
    DockPanel 提供了停靠支援. 以便可以停靠在面板一側其他控制項容易定位.

 

WrapPanel

 <Grid>        <WrapPanel  Margin="3">            <Button VerticalAlignment="Top">頂層按鈕</Button>            <Button  MinHeight="60">較高按鈕</Button>            <Button  VerticalAlignment="Bottom">底部按鈕</Button>            <Button>展開按鈕</Button>            <Button  VerticalAlignment="Center">中間按鈕</Button>        </WrapPanel> </Grid>

:

 

DockPanel

   <Grid>        <!--        NOTE: LastChildFill 屬性設定為TRUE ,這個是預設設定,則無論對 DockPanel 的最後一個元素           的其他任何停靠值是什麼, 該子項目都始終填滿剩餘的空間. 要講子項目停靠在另外一個               方向, 必須將 LastChildFill  屬性設定為 FALSE,還必須最後子項目設定顯示的停靠方向.        -->        <!--<DockPanel  LastChildFill="True">-->        <DockPanel  LastChildFill="False">            <Button DockPanel.Dock="Top">頂部停靠</Button>            <Button DockPanel.Dock="Bottom">底部停靠</Button>            <Button DockPanel.Dock="Left">左側停靠</Button>            <Button DockPanel.Dock="Right">右側停靠</Button>            <!--<Button>剩餘空間</Button>-->            <Button DockPanel.Dock="Top">剩餘空間</Button>        </DockPanel>    </Grid>

WrapPanel 和 DockPanel

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.