RAD Studio VCL Reference
TControl.SetEnabled Method

Sets the value of the Enabled property.

procedure SetEnabled(Value: Boolean); virtual;
virtual __fastcall SetEnabled(Boolean Value);

SetEnabled is the protected write implementation of the Enabled property. After changing the internal representation of the Enabled property, SetEnabled sends a Windows message back to the control so that it can respond to the change. When TControl receives this message, it invalidates the control so that its appearance reflects the change (for example, so that it appears grayed). Some descendants respond to this message in other ways (for example, windowed controls ensure that a disabled control does not have focus). 

Override GetEnabled and SetEnabled to change the implementation of the Enabled property. For example, A descendant of TControl might change the way the Enabled property interacts with an associated action. When overriding SetEnabled, be sure to call the inherited method. 


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