WPF - setting HorizontalAlignment= Stretch to Textbox in StackPanel

后端 未结 3 1755
一向
一向 2021-02-19 08:20

Why doesn\'t a textbox stretch to fill space in a stackpanel? Is this by design? In a grid, the textbox stretches as expected.

3条回答
  •  执笔经年
    2021-02-19 08:38

    I needed items to be sized evenly, but stacked vertically.

    I used a UniformGrid, and set the Columns property to 1. (tested with a TextBox, and it stretches like you want)

提交回复
热议问题