Mike Yearwood
Toronto, Ontario, Canada
Versions des environnements
Network:
Windows 2003 Server
Hi Mike
I would also recommend you use the Keypress to handle the uppercase. It has to be lots of CPU effort to reupper everything in the box versus just the individual keystroke.
>I am working on a new edit box class
>It has 2 new properties:
>1. lUpperCase - if true act as if the format is ! in text boxes... (Format='K' is the only one that works in an edit box according to help.)
>Then in the Interactive Change event I place the following code
>IF this.lUpperCase
> this.Value=UPPER(this.Value)
>ENDIF
>
>This seems to work ok
>
>Now I would also like to give the ability to hit Enter to move to the next field. Thus the second properrty lExitOnEnter
>So to that end, In the KeyPress event I've added:
>LPARAMETERS nKeyCode, nShiftAltCtrl
>IF this.lExitOnEnter
> IF nKeyCode=13
> KEYBOARD '{TAB}'
> ELSE
> DODEFAULT(nKeyCode,nShiftAltCtrl)
> ENDIF
>ELSE
> DODEFAULT(nKeyCode,nShiftAltCtrl)
>ENDIF
>
>This has the desired effect but also has two undesired effects, one major and one minor...
>
>Minor one... When enter is pressed, the edit box enters the line, the cursor drops down a line in the edit box prior to moving out, and then moves out of the box as intended. Thus it is not necessarily obvious that it worked.
>
>Major one... Repeated characters i.e. Holding a key down causes repeated characters, as fast as you can type. I tried it with the word TEST. and I got TTEEEESSTTT as the entered value. And I was just typing normally...
>
>How do I get arround this one?
>
>TIA,
>Mike
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement