Start a new line in wpf textbox

前端 未结 3 1629
情书的邮戳
情书的邮戳 2021-01-07 16:34

I created a small GUI with WPF, containing a Textbox. I want the user to have the ability to start a new line . How do I let the user start a new line in the WPF textbox (wi

3条回答
  •  悲哀的现实
    2021-01-07 17:00

    In addition to the AcceptReturn = true property, if the user wants to start a new line by pressing the enter key you will need to check these properties:

    1. IsReadOnly should be False. If you set this to True, then obviously the Enter key won't work.
    2. Verify the control containing the TextBox is not clipping the TextBox, else it will appear that the Enter key did not work.

提交回复
热议问题