Whenever I change the focus from one textbox to another it plays an irritating warning/error beep.
Example:
public void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Return)
textBox2.Focus();
}
whenever I press Enter it changes the focus to textBox2 and gives the warning beep.
Any help to disable this would be appreciated.
Thank you.
I think you want to add
e.Handled = trueto the event handler:A side node: you should be able to use the
KeyCodeinstead of theKeyCharproperty, avoiding the cast: