Multiline for WPF TextBox

前端 未结 5 1327
时光说笑
时光说笑 2020-12-12 11:57

I am developing an app for sending some feedback.

Basically I\'m trying to make a TextBox for comments, but I\'m used to the WinForms MultiLine=tr

5条回答
  •  余生分开走
    2020-12-12 12:41

    Also, if, like me, you add controls directly in XAML (not using the editor), you might get frustrated that it won't stretch to the available height, even after setting those two properties.

    To make the TextBox stretch, set the Height="Auto".

    UPDATE:

    In retrospect, I think this must have been necessary thanks to a default style for TextBoxes specifying the height to some standard for the application somewhere in the App resources. It may be worthwhile checking this if this helped you.

提交回复
热议问题