Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to find out the control focus is jumping to?
Message
De
18/12/2008 13:18:28
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
17/12/2008 15:20:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01368256
Message ID:
01368592
Vues:
10
>If I were to do it as you have suggested, that means I will have to add code to GetFocus event of almost all controls in the form and I think I can easily forget about adding the same code, if in the future I need to add new control to the form.

In the init of the form, you can build an array property, which would hold a reference to all of the controls which can get focus, and their tab order, sorted by 2nd column. The reference may be just names, and not even recursive if you don't need it to - containers are a single focus unit anyway. Then you can have a method called NextInTabOrder(toAfterThisControl), which would find your current control's row in the array, and return a reference to the next control.

Note: if you build references in the array via sys(1272), the form's name isn't what you'd expect until form's .init() exits - it's the classname or something equally generic; only after the init, when the object formally exists, it gets its .name property set. When referencing objects via their sys(1272) string, replace the first segment with "thisform".

Note2: if you keep references as object references, take care to null them all in the cleanup. Automatic cleanup may work, but once it doesn't, you'll be too busy with something else.

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