Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SetFocus Question
Message
De
23/02/1999 16:16:21
 
 
À
23/02/1999 16:11:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00190627
Message ID:
00190667
Vues:
13
>>>Hello everyone,
>>>
>>>I have the following code in the LostFocus Event of a textbox named "txtToday":
>>>
>>>IF SYS(11,THISFORM.txtToday.Value) > SYS(11,DATE())
>>> =MESSAGEBOX("message")
>>> THISFORM.txtToday.SetFocus
>>>ENDIF
>>>
>>>How come it did not give object txtToday the focus? Am I missing something, or am I merely just losing my mind?
>>>
>>
>>Add NODEFAULT before Setfocus.
>
>It works, but WHY does it work? I do not get the logic. Would you please explain? I am probably just being dense.
>
>regards,

NODEFAULT prevents default behaviour which is in this case moving to the next control in tab order. This is logical explanation. Physically, there some internal hidden code which will fire regardless do you have or have no some custom code in Control.Event. Putting NODEFAULT into this event you tell VFP not to fire this hidden code.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform