Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid valid does not fire
Message
De
07/05/2009 21:52:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01396480
Message ID:
01398497
Vues:
71
>I believe it "finally" dawned on me that there was an issue with that code. if the mouse pointer is left on the add or edit button after either are clicked, the Valid or LostFocus code does not run, "by design"...crap! I have had issues like this (valid code not running), intermittently for a while. Who knows why the light-bulb just turned on! It helps to have the coverage profiler turned on.
>
>When I removed the above reference to "cmdedit, cmdadd" the code works.
>
>Is there a better way to keep the valid from running when closing the form or canceling a process?

I once solved that by moving code from cmdbutton.click() to cmdbutton.when() - and returning .f., so the button never gets the focus. In case of OK button, I'd just thisform.activecontrol.setfocus(), which would force it to regain focus, and to do that it has to lose it first, so the validation fires.

Not sure this is the cleanest way, but at least I didn't have any concerns in the validation about whether it's been fired by a button or by user's simply leaving one control to get to the next.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform