I'm trying to have some stuff happen when a user presses enter in a textbox, and it works, but it makes a very annoying DING windows error sound when I do. I've looked up my problem, and apparently adding e.SuppressKeyPress = true; before the stuff, and e.Handled = true; after the stuff, but my program still makes the sound. This is the code I'm using:
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;
}
Am I doing something wrong? This is what the other people said you have to do, but it's not working for me for some reason...
Thanks!