TextBox expanding with surrounding Grid but not with text

前端 未结 3 834
我寻月下人不归
我寻月下人不归 2021-02-20 09:21

A window has a Grid with two columns. The left column contains a control with a constant width but with a height that adapts. The right column contains a TextBox that takes up a

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-20 10:04

    Have you tried setting the MaxWidth property on just the TextBox?

    Edit after OP's comment

    I would try getting rid of the ScrollViewer. The sizing used in the Grid's layout should take care of re-sizing and the scroll bar settings on the TextBox should take care of the rest.

提交回复
热议问题