|
-
Sep 15th, 2000, 09:57 PM
#1
I have a textbox on my form, and if the user hits the enter key, the program executes some code, but it also beeps.
How do I stop it from beeping?
-
Sep 15th, 2000, 10:06 PM
#2
Fanatic Member
If you are running some code on an enter key press, i am guessing that you are testing for the enter key. Once you know it is the enter key, set the KeyAscii / KeyCode = 0. That will stop it beeping.
Iain, thats with an i by the way!
-
Sep 15th, 2000, 10:07 PM
#3
This will solve your problem:
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
'your thing here
KeyAscii = 0
'this resets KeyAscii, so its like no key was
'pressed at all
End If
End Sub
Sunny
-
Mar 20th, 2002, 02:01 AM
#4
PowerPoster
Or you can use a hidden default button with sendkeys code in the click event
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
|