How Do I Identify from Which Control an Event Was Triggered? (Magic xpa 4.x)
An event handler can exist at a higher level than the task it is handling. A good example of this are event handlers in the Main Program, which can be universally used in any task in the project. If you want to query which control the user is parked on, you need to use the HandledCtrl() function.
-
Go to Expression Rules.
-
Type:
HandledCtrl()
or, type Ha and press Ctrl+Spacebar, and the Auto Complete feature will fill in the rest of the function name for you.
Now you can use the control name to make decisions within the event handler. For instance, you could have a generic help system that responds to characters in the control name to call specific help files.
How Do I Define an Event Handler to Be Executed Only When the User is Parked on a Specific Control?
The Online and Rich Client Samples projects (program LG15 and RLG15)