WPF - Margin in percentage

后端 未结 2 1838
忘了有多久
忘了有多久 2021-01-05 05:53

I have just started using WPF. I\'m getting my head around styling system since. I come from a CSS background and I would like to set margin in percentage.

          


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-05 06:42

    Instead of using Margin, you can do this via a Grid.

    Just place your control within a Grid element, and use 3 columns and 3 rows. The column/row sizing can be done as percentages of the containing element.

提交回复
热议问题