How to anchor controls in WPF?

前端 未结 3 1031
礼貌的吻别
礼貌的吻别 2020-12-14 15:09

I have a a TreeView that fills the top part of the application, but since the number of items in the TreeView changes, my Apply button changes its

3条回答
  •  死守一世寂寞
    2020-12-14 15:54

    To achieve anchoring, Set following properties:

    • Width="auto"
    • Height="auto"
    • VerticalAlignment="Stretch"
    • HorizontalAlignment="Stretch"
    • Set margins as needed.

    Example:

        
    

提交回复
热议问题