Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SetFocus() from within a LostFocus event acting strangel
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00465934
Message ID:
00466043
Vues:
13
Well,

I put on my OO hat and "fixed" my problem with a work around.

All valids now look like this:
========================================================
Local llReturnValid

If NOT this.ilValid_Done
llReturnValid = this.em_valid()
If llReturnValid
This.ilValid_Done = .T.
EndIf
ELSE && The valid was executed before and returned a true. We are here again due to bug??
llReturnValid = .T. && Tell it we are REEEEEALY sure we were true and valid.
EndIf

RETURN llReturnValid

=========================================================

All lostfocus now look like this.
---------------------------------------

This.em_LostFocus()
* We have completed the LostFocus execution and can allow the Valid to run again.
this.ilValid_Done = .f.
RETURN .T.

---------------------------------------

I have not tested if this works right when we return a number from em_valid to jump fields, but it works as I expect valid and lostfocus with a lostfocus contained setfocus should. I get the setfocus and valid only "runs" once. Well, Valid runs twice, but my code in em_valid runs only once.

I sure like using Drew Speedie's hack tool he ships with Visual MaxFrame to change all textboxes in a form to point to my new object class! Too bad this project is not using Visual MaxFrame. I would have had a nice place to put my code in his object tree. But.... Next project! (I hate CONVERTING old 2.6 code!)

Thanks for the input. AND if anyone wants to try a setfocus with tracing tools in place to see if other service packs of VFP6 run the same way, let me know.

I can't imagine the valid firing twice being intended.
Weldon Adair
Adair Software Corporation
(561) 445-8091
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform