停止输入键 [英] Stop ding on enter key
本文介绍了停止输入键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
确定在智慧结束时(虽然这是一次短途旅行)
我在弹出菜单上有一个文本框,当我输入文字时,然后按回车键我得到了一个声音。研究了cr @ p,没有任何效果。
代码本质上是......
Ok at wits end (though it was a short trip)
I have a textbox on a popup menu, when I enter text, then press the enter key I get a ding. Researched the cr@p out of it and nothing works.
The code is essentially...
Private Sub ToolStripTextBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles ToolStripTextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
e.Handled = True
e.SuppressKeyPress = True
Process(ToolStripTextBox1.Text)
End If
End Sub
我是什么尝试过:
我已经同时使用了e.Handled = True和e.SuppressKeyPress = True以及组合/顺序,似乎没有什么能阻止ding!
What I have tried:
I've used both the e.Handled = True and e.SuppressKeyPress = True alone and in combination/order and nothing seems to stop the ding!
推荐答案
控件中是否有其他按钮?如果您在按Enter键时选择其他按钮或控件,则会出现一种解决方案。
当textbox.multiline = false并且没有其他控件可供选择时。
看看这里: https:// support.microsoft.com/en-us/kb/140882 [ ^ ]
希望这会有所帮助!
Did you have any other button in the control? One solution comes if you select that "other" button or control when you press enter.
It happens when the textbox.multiline=false and there's no other control to select.
Take a look here: https://support.microsoft.com/en-us/kb/140882[^]
Hope this helps!
这篇关于停止输入键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文