Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set focus without using setfocus()
Message
De
01/03/2004 12:13:17
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
29/02/2004 21:41:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00881299
Message ID:
00882086
Vues:
59
This message has been marked as the solution to the initial question of the thread.
>>>>As a workaround, if you can't SetFocus() within the Valid() event, you might postpone it with a Timer (with a brief interval). But I don't know whether this works; perhaps the Valid() will then fire again.
>>>
>>>The real problem is that the form that does the setfocus is completely ignorant of the valid event. The valid() is occuring in another form
>>
>>You could use the aStack() to see if there's a valid, range* etc somewhere on the stack. But it would still be a kludge :).
>
>So what do people do in general?? Use the lostfocus() with a nodefault if validation fails??

Yes, but keep the validation somewhere else. In a lostfocus,
if not this.myvalid()
   nodefault
endif
You can do this at the top class level, and then write a little builder which will just move any code you had in valid() into myvalid().

Conclusion: valid method, as it is, with all the limitations and quirks, is nearly useless.

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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform