TextBox Sound Problem.

  • Thread starter Thread starter ShoCkwave
  • Start date Start date
S

ShoCkwave

I assigned Enter key to do sth after I write sth to a TextBox but I
gives me a system sound like "this is not multiline textbox enter
does not work here " and Beeps.

I dont want this sound to be played. How can I avoid this? Thanks...
Posted at: http://www.groupsrv.com
 
Override IsInputKey method like following :
class TextBox2:TextBox {
protected override bool IsInputKey(Keys keyData) {
if (keyData==Keys.Enter) return true;
return base.IsInputKey (keyData);
}
}

And use in your form TextBox2 instead of TextBox. There will be no more
beep.

Hope it helps,

Ludovic Soeur.

ShoCkwave said:
I assigned Enter key to do sth after I write sth to a TextBox but I
gives me a system sound like "this is not multiline textbox enter
does not work here " and Beeps.

I dont want this sound to be played. How can I avoid this? Thanks...
Posted at: http://www.groupsrv.com
 
Back
Top