Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
好吧,我的问题是这样的:我在表单上设置了 AcceptButton,这给了我很好的效果,它触发了按钮 Click 事件,但是如果我在 MultiLine 文本框上,我不希望这种情况发生。然后我只希望它在其中输入一个输入。
有没有办法做到这一点?
将文本框的“AcceptsReturn”属性设置为 true。
控件上有一个属性TextBox:
TextBox
textbox1.AcceptsReturn = true;
MSDN 文档