RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TContainedAction.Execute Method

Responds when the client control "fires".

Pascal
function Execute: Boolean; override;
C++
virtual __fastcall Boolean Execute();

Execute is called automatically when a client control "fires" (for example, when the user clicks a button or selects a menu item). It returns true if an event handler is found to handle the action, false otherwise. 

Execute first attempts to handle the action by generating an OnExecute event on the action list that contains this action (if the action belongs to an action list). If the action list's OnExecute event handler does not handle the action, Execute generates an OnActionExecute event on the application itself. If neither the action list nor the application handles the action in response to these events, Execute generates an OnExecute event on itself. If this action has no OnExecute event handler, it instructs the application to locate the current target control and call the ExecuteTarget method, which is the mechanism by which predefined action classes perform their function. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!