Home All Groups Group Topic Archive Search About
Author
26 Mar 2005 1:36 AM
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

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------       
                http://www.usenet.com

Author
26 Mar 2005 9:10 AM
Ludovic SOEUR
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.

Show quote
"ShoCkwave" <orcunbas***@msn-dot-com.no-spam.invalid> a écrit dans le
message de news:4244bcba$1_4@127.0.0.1...
> 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
>
>  Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
>     ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
>                 http://www.usenet.com
Author
26 Mar 2005 7:36 PM
ShoCkwave
Well,

I discovered how to overcome to this. Enabled Multiline but after
Pressing enter I set text to Null and yes! No sound and it works.
Posted at: http://www.groupsrv.com

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------       
                http://www.usenet.com

AddThis Social Bookmark Button