Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine whether a textbox is having focus?
Message
De
20/12/2010 03:50:42
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01493326
Message ID:
01493337
Vues:
89
>>Hi,
>>
>>Programmatically, if I am in a method of a textbox, is there anyway I can determine whether the textbox itself is currently the active control which has focus?
>>
>>tslim
>
>Have you tried testing thisform.ActiveControl.name ?

Not enough. It could be a control in one of many containers of the same class, and a member in each of these containers would have the same .name. We'd have form.container1.textbox1, form.container2.textbox1 again etc. Instead, compobj(thisform.activecontrol, this) would do it.

Though it's possible that nothing has control at the time, i.e. thisform.activecontrol may be null, so some checking needs to be done.

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