From RAD Studio API Documentation
Jump to: navigation, search


property OnActionExecute: TActionEvent read FOnActionExecute write FOnActionExecute;


__property System::Classes::TActionEvent OnActionExecute = {read=FOnActionExecute, write=FOnActionExecute};


Type Visibility Source Unit Parent
event protected
Vcl.AppEvnts TCustomApplicationEvents


Occurs when an action's Execute method is called and its action list has not already handled it.

Use the OnExecute event handler to respond when a user invokes actions whose action lists do not have OnExecute event handlers.

If the action list that contains the action does not handle it in an OnExecute event handler, then the action is routed to the Application object's OnActionExecute event. The application events object hooks this event and responds with its own OnActionExecute event handler.

The Handled parameter of the event handler returns false by default. If the handler handles the event, it should change Handled to true, thereby preventing further attempts to handle the action. When the event handler exits with Handled set to false, the event first goes to any other application events objects, and then the action's OnExecute event occurs. If the action remains unhandled after that, the active control's ExecuteAction method is called to allow the action to execute with an identified target. Finally, the active form's ExecuteAction method is called if all other handlers do not handle the action.

Note: Call the CancelDispatch method from an OnActionExecute event handler to prevent the application from forwarding the event to any other application events objects.

See Also

Code Examples