General information
Category:
Forms & Form designer
>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
Hi Marc,
Sounds best to use a property of the form. Adding some code to the gotfocus of object base classes should do it.
I've had other related problems with "when" not firing. It seems it's been shoe-horned in for backward compatibility.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only