Preventing "ding!" on Esc or Enter in a textbox

  • Thread starter Thread starter Nic L
  • Start date Start date
N

Nic L

Anybody know how to prevent the ding sound from happening when the escape or
enter key is entered into a textbox? I need to catch the enter and escape
keys for processing.

I've the following event handler for on the Keydown event of the text box,
but I'm still getting the ding sound.

private void EditBoxKeyDown(object sender, System.Windows.Forms.KeyEventArgs
e)
{
if ( e.KeyCode == Keys.Enter )
{
/* do some processing */
e.Handled = true;
}
if ( e.KeyCode == Keys.Escape )
{
/* do some processing */
e.Handled = true;
}
}
 
Back
Top