Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Numeric Textbox Woes
Message
De
06/07/1998 10:00:09
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00114109
Message ID:
00114515
Vues:
20
>>Try...
>>
>>ON KEY LABEL HOME *
>>ON KEY LABEL END *
>>keyboard "{END}"+"{SHIFT+HOME}"
>>
>>in the GOTFOCUS() and
>>
>>ON KEY LABEL HOME
>>ON KEY LABEL END
>>
>>in the VALID().
>>//:^)
>Larry,
>
>The problem qwith OKL's is that they are intercommand interrupts which will break in between executing lines of code. That menas if the textbox has focus and a method of something else fires and the user presses an OKL the code running will be interrupted.
>
>With the controls we have in VFP it would be much better to write code in the textboxes Keypress event to trap the keys you don't want and issue a NODEFAULT to ignore them than to use OKL's.
I was trying to use the KeyPress and could not figure out how to ignore the keystrokes. So with the NODEFAULT, would the code in the KeyPress() be something like this for a numeric field?

PARAMETERS nKeyCOde,
IF NOT ISDIGIT(CHR(nKeyCOde)) and NOT CHR(nKeyCode)='.'
NODEFAULT
ENDIF
L.A.Long
ProgRes
lalong1@charter.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform