|
-
May 15th, 2013, 11:50 PM
#1
Thread Starter
Lively Member
Textbox_Keypress = 13 Event produces sound
I have code similar to the following in my project:
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
MsgBox "Enter pressed.",vbOkonly,"Result"
End If
End Sub
Why does this produce similar to a 'ding' sound in Windows, and what can I do to stop it? I prefer not to mute my speakers, surely there is something that can be done to suppress the sound.
-
May 15th, 2013, 11:54 PM
#2
Re: Textbox_Keypress = 13 Event produces sound
Which operating system are you using?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
May 16th, 2013, 12:00 AM
#3
Thread Starter
Lively Member
Re: Textbox_Keypress = 13 Event produces sound
I'm sorry, I should have included that.
Using Windows 7 Ultimate.
-
May 16th, 2013, 12:02 AM
#4
Re: Textbox_Keypress = 13 Event produces sound
If your TextBox isn't MultiLine, then you will indeed hear a "ding" sound.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
May 16th, 2013, 12:05 AM
#5
Thread Starter
Lively Member
Re: Textbox_Keypress = 13 Event produces sound
So I'd have to change to multiline to stop the ding sound... Will see if that works in my project.
Thanks Bonnie West.
-
May 16th, 2013, 12:06 AM
#6
Re: Textbox_Keypress = 13 Event produces sound
To explain further what Bonnie is saying read the last post here.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
May 16th, 2013, 12:08 AM
#7
Thread Starter
Lively Member
Re: Textbox_Keypress = 13 Event produces sound
My textboxes use only one line. If I set them to MultiLine, when I press enter the textbox looks like it clears (because it's going to the next line).
Not sure how to solve this?
-
May 16th, 2013, 12:10 AM
#8
Re: Textbox_Keypress = 13 Event produces sound
 Originally Posted by funkyjtq
My textboxes use only one line. If I set them to MultiLine, when I press enter the textbox looks like it clears (because it's going to the next line).
Not sure how to solve this?
Adjust the height of the textbox.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
May 16th, 2013, 02:06 AM
#9
Re: Textbox_Keypress = 13 Event produces sound
Add a line to your code
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii=0
MsgBox "Enter pressed.",vbOkonly,"Result"
End If
End Sub
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
|