how can I stop the beep when I press the return key ?

  • Thread starter Thread starter Guest
  • Start date Start date
It depends on the control.

For a textbox, override OnKeyPress method like the following lines :
protected override void OnKeyPress(KeyPressEventArgs e) {
if ((int)e.KeyChar==13) e.Handled=true;
else base.OnKeyPress (e);
}

For a NumericUpDown control, use these lines :
protected override void OnTextBoxKeyPress(object source, KeyPressEventArgs
e) {
if ((int)e.KeyChar==13) e.Handled=true;
else base.OnKeyPress (e);
}

Hope it helps.

Ludovic SOEUR.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Capturing key event and remove beep! 2
No boot-up beep....sometimes 4
How to stop my beep? 3
Keep Key Pressed 2
Hidden device "Beep" 1
How do I stop beeps? 10
how to suppress beep (beep sound) 4
BEEP while working 4

Back
Top