Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preventing duplicate entries
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00118204
Message ID:
00121869
Vues:
22
>You said in your code comments "* Set focus to the same control to force the valid and lost focus to fire". How does setting the focus to same control we are already on cause the lostfocus and valid to occur?

Richard,

Because the SetFocus call causes the control to first lose focus and then regain it. It is like giving VFP a kick in the pants. The same is true for relations a GOTO RECNO() which mvoes the record pointer to the same record but make VFP think the pointer has moved so it does all of teh background stuff it needs to do for a record pointer move.

If your Valid code isn't firing then there may be something else wrong. Either that or the valid is firing and it isn't doing what you expect it to.

Try this to see for yourself. Put a text box in a form, in the Valid write WAIT WINDOW "Valid" and in the keypress write THIS.SetFocus(). Run the form and type in the textbox. What do you see?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform