Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
(VFP) Forms that much harder than (FPW) screens?
Message
De
28/02/2001 12:14:43
 
 
À
28/02/2001 09:46:51
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00480200
Message ID:
00480589
Vues:
9
>I did code this in the KeyPress before I ask this here. There was nothing, not wait window (so meaning it's the "wrong" place?). And yes, this was the whole propose that Enter fires TABLEUPDATE() and Escape fires TABLEREVERT(), but I need to locate WHERE to put these codes. I want (well, THEY want) to only make this effective only while the cursor is in the textbox (since there is no "Revert" button, just a "Save" button, I know, weird, lot of disabling/enabling). What else you suggest?
>

I don't think you're listening. Characters like 'Tab', 'Enter' and 'Escape' leave the control and are not picked up by it - you'd have to use the Form's KeyPress via KeyPreview. If you want to check the exit keystroke in your valid, use LASTKEY() not INKEY(). This is so simple it's hard to explain to you - the key that triggers the event isn't part of the value of the control, so it doesn't register there.

>Chuck
>
>>>IF INKEY() = 27
>>> wait window 'Esc key pressed'
>>>ELSE
>>> IF INKEY() = 13
>>> wait window 'Enter key pressed'
>>> =TableUpdate(.T.)
>>> ENDIF
>>>ENDIF
>
>>You could trap the KeyPress event of the textbox control to react to the Enter or Escape; KeyPress receives the keycode for each keystroke other than Alt-key sequences or things like Tab. You can process all keystrokes in the Form's KeyPress event by setting the Form's KeyPreview to .T.
>>
>>BTW, if you want to TABLEUPDATE() on Enter, you probably want to TABLEREVERT() on Escape.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform