Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine whether a textbox is having focus?
Message
De
21/12/2010 04:16:58
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
21/12/2010 01:52:43
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:
01493440
Vues:
62
>>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.
>
>What if I add a property say lHasFocus, then set its value each time when the event GotFocus and LostFocus are triggered...
>will I still miss anything?

The framework I use has that, so I guess it's been tried already. Why not. I've also seen frameworks where a form-level method would do all the checking and return a reference to the active object, so you'd have something like

if thisfrom.WhatIsActiveControl()=this

which also worked. As usual, it can be done three ways in Fox, or isn't worth doing :).

It's possible that other code may run while your control still has focus - timer events, grid refreshes, toolbar buttons code, OKL. These don't take focus away.

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