Disable beep of enter and escape key

You have to prevent the KeyPressed event from being generated, that’s the one that beeps. That requires setting the SuppressKeyPress property to true. Make that look similar to:

if ((e.KeyCode == Keys.Enter) || (e.KeyCode == Keys.Tab))
{
    Parent.SelectNextControl(textBox_Zakljucak, true, true, true, true);
    e.Handled = e.SuppressKeyPress = true;
}

Leave a Comment