How to stop my beep?

  • Thread starter Thread starter Keith Smith
  • Start date Start date
K

Keith Smith

Whenever a KeyDown event is launched my app makes a "beep". How can I stop
this annoying beep?

If this doesn't make sense then I could post some code.
 
Adam said:
Yes, as long as you set e.Handled to true, the beep should go away.

I still can't seem to get rid of the beep. I have tried my code two ways...

#1...

private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
e.Handled=true;
if (e.KeyValue==13)

{
this.ActiveControl = GetNextControl(textBox1,true);
}
}

#2...

private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue==13)

{
e.Handled=true;
this.ActiveControl = GetNextControl(textBox1,true);
}
}

What am I doing wrong?
 
Keith,

Can you try this one. (My beep is disconnected in my computer.)

\\\Key Press event
private void KeyPressed(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar==(char)13) e.Handled = true;
}
///

I hope this helps?

Cor
 
Back
Top