WPF: Grid with column/row margin/padding?

前端 未结 15 1104
梦毁少年i
梦毁少年i 2020-12-07 23:57

Is it easily possible to specify a margin and/or padding for rows or columns in a WPF Grid?

I could of course add extra columns to space things out,

15条回答
  •  旧时难觅i
    2020-12-08 00:09

    Though you can't add margin or padding to a Grid, you could use something like a Frame (or similar container), that you can apply it to.

    That way (if you show or hide the control on a button click say), you won't need to add margin on every control that may interact with it.

    Think of it as isolating the groups of controls into units, then applying style to those units.

提交回复
热议问题