Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Edit box class - user press enter - leave box
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Edit box class - user press enter - leave box
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01233227
Message ID:
01233227
Vues:
51
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform