Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to keep cursor in field till data input is correct?
Message
 
À
12/02/2000 20:36:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00331251
Message ID:
00332074
Vues:
15
>>Now I have another question... I may want to let the user leave the field that I'm validating with incorrect data _if_ they are hitting the "cancel" button.
>
>Make sure you set the Cancel buttons Cancel property to .T.
>
>Then, in your Valid(), put:
>
>
if lastkey() = 27
>	return .t.
>else
>	&&Normalcode
>endif
>
>because if you press a cancel button, it makes the last key equal to hitting the escape key.

Hello,
I tried it too and it doesn't work properly. I have new form, one textbox with valid method described above, and two buttons - OK and Cancel, both doing ThisForm.Release in Click method, but the Cancel buton has the property Cancel=.t., while Ok has not. I run the form and click the Cancel with mouse. Valid gets lastkey 27 (I see it in my wait window message) and loses focus. Then the Cancel button gets focus, but the release of the form is not executed. If I hit the Cancel button once more, then it releases. What am I doing wrong?
(Form is modal).
Thanks for explanation
Petr
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform