PC Review


Reply
Thread Tools Rate Thread

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

 
 
Guest
Posts: n/a
 
      17th Feb 2005
Thank you for taking time out to answer my question


 
Reply With Quote
 
 
 
 
Ludovic SOEUR
Guest
Posts: n/a
 
      17th Feb 2005
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.


<(E-Mail Removed)> a écrit dans le message de
news:cv0tg9$bb5$(E-Mail Removed)...
> Thank you for taking time out to answer my question
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to run a macro when i press return =?Utf-8?B?Q29uY3JldGUgSGlwcG8=?= Microsoft Excel Programming 2 3rd Aug 2005 09:21 AM
RE how can I stop the beep when I press the return key ? Many thanks just what I needed Microsoft C# .NET 0 17th Feb 2005 05:50 PM
Re: System Beep on Return, Escape, etc. in TextBox Mike McIntyre Microsoft Dot NET Framework Forms 0 22nd Sep 2004 08:25 PM
System Beep on Return, Escape, etc. in TextBox =?Utf-8?B?QWxleCBNYWdoZW4=?= Microsoft Dot NET Framework Forms 0 22nd Sep 2004 05:59 PM
Return Key Press Tracey Microsoft ASP .NET 1 15th Dec 2003 05:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:12 AM.