| Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 | 1. Ding sound from ENTRY #8205 | I have an ENTRY box into which the user types a four letter code. When I type a return key after entering those four character, windows plays the ding.wav sound. How do I get rid of that?
P.S. It dings whether or not the "want return" option is selected. I tried typing a TAB instead of enter but that doesn't cause the UNFOCUS event. | 2. Re #8212 | Did you send the ENTRY a message to limit the amount of text that can be entered to only 4 characters? If so, as I recall, when you press Enter, Windows considers that the fifth character and "dings" as an error indication. As I recall, the way to get rid of that is to have a default style PUSH button so the Enter gets siphoned off as a "click" on the button.
There's another alternative. Am I correct in assuming that your input window has only an ENTRY and nothing else in it? You're handling its UNFOCUS event, so when he types Enter, your UNFOCUS event is called and you grab the value of the ENTRY and close down the window?
Another alternative is to handle the "CHANGE" event for the ENTRY. Get the ENTRY's current value, and if the length is 4 characters, then do what you would have done in the UNFOCUS handling.
This way, as soon as he enters the fourth character, you're ready to go. He doesn't have to press ENTER. And you can even do pattern matching. For example, let's say that only one of your possible birds begins with the letters DO. As soon as you see that he has typed 2 letters, and they happen to be DO, then you already know which bird he wants. You can set the value of the ENTRY to the appropriate text, and then do what you need to do right then.
Assuming your ENTRY's variable is MyEntry, it would sort of be like this:wm_change_myentry:
guigetctlvalue("MyEntry")
IF LENGTH(myentry) == 2 && myentry = "DO" THEN DO
myentry = "Dove"
SIGNAL useit
END
ELSE IF LENGTH(myentry) == 4 THEN DO
useit:
guidestroywindow()
END
RETURN | 3. Re: Ding #8218 | Hi Jeff, I have limited the input to 4 characters so, as you say, that's where the ding must be coming from. I tried setting it to 5 but the ding still occurred - even with "Want Return". I have added a push button with Tabstop and Default. If I type a TAB at the end of the entry there's no ding. If I type a return it dings but takes the entry anyway. I can live with that :-)
Pete | Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
|
|