|
-
Jun 15th, 2002, 10:01 PM
#1
Thread Starter
PowerPoster
ding weirdness w/ text box
I noticed recently that one of my applications creates an annoying ding under certain conditions. I didn't notice it before because my external speaker driver apparently takes over the PC's sound control and if the external speaker is off, there is no sound at all, and I normally have the external speaker off. I thought the internal speaker would still ding, but it doesn't
In attempting to reduce the code down so as to be able to give a simple explanation of when the "problem" occurs, I was amazed to find that all I need is a form with one text box and no code at all !!! Every time I hit the enter key, I get a ding.
This may be stunningly obvious to some of you, but I'm quite taken aback. Again, I have one form with one control, a text box, and every time I hit the enter key, whether or not I have entered text into the text box, I get a speaker ding.
Can anyone tell me what the blazes is going on ???
Thank you for your time
-
Jun 15th, 2002, 10:04 PM
#2
You need to use the Keypress event.
Code:
Private Sub Text1_Keypress(KeyAscii as Integer)
if KeyAscii = 13 then
KeyAscii = 0
End if
End Sub
-
Jun 15th, 2002, 10:22 PM
#3
What is happening is that the control is telling you that an error has occurred. That "error" in this case is that it can't create the second line which is what you would expect to happen in a document etc., when you click the enter key. If you set the Multiline property of the textbox to True the problem will go away.
-
Jun 15th, 2002, 10:43 PM
#4
Thread Starter
PowerPoster
jeez, two different workable solutions in no time at all.
Thanks guys.
what a great forum.
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
|