Results 1 to 4 of 4

Thread: ding weirdness w/ text box

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904

    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

  2. #2
    jim mcnamara
    Guest
    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

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    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.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    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
  •  



Click Here to Expand Forum to Full Width