How to get button content to fill width in WPF

后端 未结 2 592
面向向阳花
面向向阳花 2020-12-19 01:52

In the following XAML the button will stretch to fit the width of the window, including as you resize the window. However, the TextBlock and blue box are centered. How wou

2条回答
  •  清酒与你
    2020-12-19 02:20

    You should set Button.Template. Also Grid.ColumnDefinitions can be used to set the position and width of elements inside properly.

            
    

提交回复
热议问题