Nat*_*han 5 .net c# windows visual-studio-2010 winforms
当用户按下文本框中的输入时,我正试图让某些事情发生,并且它可以工作,但是当我这样做时,它会产生一个非常烦人的DING窗口错误声音.我已经查找了我的问题,并且显然e.SuppressKeyPress = true;在这些内容之前添加了内容,然后e.Handled = true;我的程序仍在发出声音.这是我正在使用的代码:
private void textBox1_KeyUp(object sender, KeyEventArgs e)
{
e.SuppressKeyPress = true;
if (e.KeyCode == Keys.Enter)
{
// A bunch of stuff goes here that I want to
// happen when the user hits enter
}
e.Handled = true;
}
Run Code Online (Sandbox Code Playgroud)
难道我做错了什么?这是其他人说你必须要做的事情,但由于某些原因它并不适合我...
谢谢!