Turning off Bell

  • Thread starter Thread starter WizyDig
  • Start date Start date
W

WizyDig

I've looked every where for this answer and it seems so simple of a
question. How do you disable the bell that dings when you press enter
in a .NET windows app text box?

Wiz
 
WizyDig said:
How do you disable the bell that dings when you press enter in a .NET
windows app text box?

Add this handler to your text box' KeyPress event:

private void textbox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r')
e.Handeled = true;
}

Petter
 
Hey thanks Peter. That answer makes sense they alarm goes off to
indicate you pressed enter and you have to acknowledge you are handling
the press enter event. The documentation on the alarm is very sparse.

-Wiz
 
Back
Top