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
 

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

Back
Top