Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return .f. in valid event
Message
De
03/08/1999 12:52:49
 
 
À
03/08/1999 10:11:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00249103
Message ID:
00249295
Vues:
29
>>If your cancel button has it's cancel property set to .T., then it also set LASTKEY() to 27 when it is clicked. This menas you can code your valid event like:
>>
>>IF LASTKEY() <> 27 AND (SomeCondition)
>>RETURN .F.
>>ENDIF
>
>Erik,
>
>I think LASTKEY() isn't a good solution because if you try to quit the field using the mouse then LASTKEY() may be on 27, but this doens't mean you left the field using the escape key. I agree this solution works in conjunction with a cancel button, but if the user doesn't want that you have a problem ...
>

The LASTKEY solution has holes, but I thknk it should always be backed up with field by field validation when the user tries to save. The user can also get out by depressing the mouse button over the cancel button and dragging the mouse off. This causes LASTKEY to be set, but not the click method to run.

>This is the solution that I usually use : the valid condition of individual fields always accepts an empty field. When the OK button is pressed, I check for empty fields that must be filled and refuse to continue if there are ...

This is what I always do too. But occasionally a user demands to be notified before leaving the field.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform