Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine what other control a control is losing focus t
Message
De
04/05/1999 00:08:36
 
 
À
03/05/1999 23:16:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00214778
Message ID:
00214835
Vues:
22
>Hi Christopher ---
>
>Yup. There sure is. The following code will pop a WAIT WINDOW telling you where focus is headed (LostFocus code):
>
>** Control.LostFocus
>FOR i = 1 to THIS.Parent.ControlCount
>   IF THIS.Parent.Controls(i).TabIndex = THIS.TabIndex + 1
>      WAIT WINDOW "Next will be "+THIS.Parent.Controls(i).Name
>   ENDIF
>ENDFOR
>
>Adapt as you see fit :-)
>

Obviously, this will only work if the tab key was pressed, and not Shift+tab, Left-arrow, or a mouse click.

If you are desparate though, you could use this in combination with the knowledge that when clicking from control to control, the next control's when event will fire before the previous control's lostfocus (this behavior is different when tabbing: both valid and lostfocus fire before the next control's when event). Using this, you could set up a scheme where every control sets a form property to its name inthe when event, then you could check this proprety in the of the control losing focus' lostfocus event.

Pretty kludgy though, if you ask me. Every time I thought I might need behavior like this, I figured out a better design that didn't require it.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform