Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set focus without using setfocus()
Message
De
28/02/2004 20:38:08
 
 
À
28/02/2004 17:22:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00881299
Message ID:
00881836
Vues:
26
Hi!

Just change the "this.setfocus()" to "nodefault" in the lostfocus of the control

Sarosh

procedure lostfocus
if empty(this.value)
messagebox('Invalid')
*this.setfocus()
nodefault
endif


>>Hi!
>>
>>Don't use the Valid Event use LostFocus instead and then if you want to stay in that same control maybe your validation routine returns false then just setfocus back to the same control [This.SetFocus()]
>>
>>Sarosh
>
>If I put two textboxes on a form. One with...
>procedure lostfocus
>if empty(this.value)
> messagebox('Invalid')
> this.setfocus()
>endif
>
>and the other with
>procedure gotfocus
>messagebox('Got me')
>
>You will see that on tabbing out of box 1 you still get both messages and box 2 gets the focus anyway!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform