RAD Studio VCL Reference
TCustomAction.DisableIfNoHandler Property

Indicates whether client components should be disabled if no handler is found.

property DisableIfNoHandler: Boolean;
__property Boolean DisableIfNoHandler;

DisableIfNoHandler specifies whether the Enabled property of client components should be set to false if no handler can be found for the action.  

When the user triggers one of the action's clients, the application makes a series of attempts to determine how the action should respond. This includes checking a number of event handlers, and, if it fails to find an event handler, locating a target control and checking for a predefined response that applies to that target control. When DisableIfNoHandler is true, if the application completes this sequence without finding any way for the action to respond to the user input, The action's Enabled property is set to false.  

In addition, for some predefined actions, DisableIfNoHandler causes the action to disable itself if an event handler is required for the action to perform a meaningful task. For example, if you do not supply an OnAccept event handler to TFileOpen, then if DisableIfNoHandler is true, the action disables itself because there is no way for the application to respond when the user selects a file name in the dialog. 


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