Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why click twice to get past valid event
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01044258
Message ID:
01044262
Vues:
9
>I have a form with a grid and a ADD, Save, Delete buttons. The ADD changes to Cancel. Why do I have to click twice on the Cancel button to cancel an ADD? here is the code in my valid event. In debug, the grid text shows focus and not the clicked button. Here is the valid event code:
>
>
>* get reference to object under mouse pointer
>oLoc = sys(1270)
>if vartype(oLoc)="L"
>	oLoc = This
>endif
>
>* is the location the Close or the Add/Cancel button
>IF inlist(lower(oLoc.name),"cmdclose","cmdAdd")
>    RETURN .T.
>ELSE
>    SomeCode
>ENDIF
>
>
>Thanks, Chuck

I don't know, but I find it easier to postpone most validation until the record is saved. In other words, instead of validating input in the Valid() or LostFocus() event, I put all validation in the method that saves changes to the current record.

A validation function consults a table of validation rules, and shows the user the corresponding error messages.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform