|
-
Jan 24th, 2005, 10:52 AM
#1
Thread Starter
<?="Moderator"?>
On Return Stop Beep [RESOLVED]
I have a textbox which the user enters a search query into, now when they hit return it searches. So they dont have to move the mouse to hit the search button. But when ever the return key is hit in the textbox its makes a beep sound. Is there a way to stop it making a noise?
Im using the onKeyDown event of the textbox to capture the key press.
Thanks
Last edited by john tindell; Jan 28th, 2005 at 10:30 AM.
-
Jan 24th, 2005, 06:33 PM
#2
Re: On Return Stop Beep
Instead of trying to handle the search in the key events of the Textbox, add a Search button, now assign it to the AcceptButton property of the form. Now, whenever the Enter key is pressed, the Search button will be clicked, giving you the same result without having to handle key events.
-
Jan 24th, 2005, 06:59 PM
#3
Re: On Return Stop Beep
use the KeyPress Event to stop the Beep ( e.Handled = true for the Enter Key ) eg:
PHP Code:
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if(e.KeyChar == (char)Keys.Enter)
{
// stop the Beep like this...
e.Handled = true;
}
}
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jan 28th, 2005, 10:30 AM
#4
Thread Starter
<?="Moderator"?>
Re: On Return Stop Beep
cheers Aaron that was exactly what i was looking for, thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|