我有多行编辑框(MFC)。如果用户按 Enter,则默认按钮已按下并且对话结束(显然)。如何允许用户ENTER在编辑框中使用下一行的键?我读到,我应该ES_WANTRETURN
为这个 EDIT_CONTROL 使用样式,但是怎么做呢?如果我还没有创建程序?我有从 *.rc 文件生成的模态对话框。感谢您的帮助。我需要一些简单的方法:-)
问问题
176 次
1 回答
2
Resource Editor
I set a few properties in the resource editor for the CEdit
control:
Horizontal Scroll - I set it to false otherwise the text will not word wrap.
Vertical Scroll - I set it to true so that you can still view all text when it becomes too much for the control to display.
Multiline - Set it to true because we want multiline.
Want Return - Set this to true if you want the user to insert a new line when they press the Enter key (when the control has focus).
Resource File
In my RC file such a control is defined like this:
EDITTEXT IDC_EDIT_NOTES_OPENING,15,27,200,32,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL
于 2021-03-30T14:15:43.863 回答