Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hotkey Puzzle.
Message
From
23/11/1998 09:34:31
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00160431
Message ID:
00160435
Views:
10
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform