Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hotkey Puzzle.
Message
De
23/11/1998 09:34:31
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00160431
Message ID:
00160435
Vues:
17
>Hi,
>
>Command buttons can have a hotkey defined via the \<. So when the user presses the hot key, the click eventmethod is executed.
>
>But I need to know which (other) control had the focus when the command button was clicked, so I found out that you can set a cActiveControl property to the name of the control that has the focus by issuing
>
>this.cActiveControl=upper(thisform.activecontrol.name)
>
>in the when eventmethod() of the button.
>
>In the Click() eventmethod you can then conditionally execute code based on the setting of the cActiveControl property.
>
>My problem is that when the user presses the hotkey, the when eventmethod() is not executed, so the click() method does not know "who called".
>
>Anybody found a way to encapsulate this functionality in the command button allone, or are we to use the form to manage this?
>
>TIA,
>
>Marc

I saw many times, that Button.When event is highly unreliable in this situation. The 100% guaranteed approach is to subclass form.controls with Thisform.LastActiveControl=This in Parentclass.GotFocus event.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform