Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to SetFocus() from Valid()?
Message
De
11/06/2002 00:57:21
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
10/06/2002 14:58:36
Charlie Hancock
California Dept of Public Health
Richmond, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00666645
Message ID:
00666800
Vues:
20
Hi Charlie,
the problem is that you can not setfocus from valid (or from a method called from valid).

A timer may be of help.

Add a timer to your form, enabled=.f.; interval to something short (but not to short); in the timer event call the second form like
this.enabled=.f.
secondform.show()
In the valid of your textbox add
...
otimer.reset()
otimer.enabled=.t.
Agnes


>My application has two forms visible: one, in the foreground, is a data entry form, the other, in the background, displays a grid of possible duplicate records. The desired behavior is that the user will enter a customer's first & last name in the first form. The last name textbox's .Valid() code then calls a method in the second form that searches for and displays any existing customers with matching names. So far so good. At this point, I want to bring the second form to the top, which is where I'm having the problem.
>
>I know I can't SetFocus() to the second form's grid (or to anyplace else)from the first form's textbox Valid() event. The documentation suggests using .LostFocus() as a place to do that. But when I try, the second form's grid momentarily gets the focus, then focus jumps right back to the first form (in the data entry textbox following the last name textbox). The same occurs when I call the second form's .Show() event. Any ideas on how to keep focus on the second form once it gets there?
>
>Thanks in advance!
>
>Charlie Hancock
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform