[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Controls' (#lcl)

# TWinControl.SetColor

Sets the value for the Color property.

## Declaration

Source position: controls.pp line 2309

`protected procedure TWinControl.SetColor(`
`Value: TColor`
`); override;`

## Arguments

`Value` |  | New value for the Color property.

## Description

SetColor is an overridden method in TWinControl used to set the value for the Color property. It calls the inherited method on entry, and ensures that the new property value is applied to the internal TBrush instance used in the control. This includes translating the value clDefault to the actual brush color used for the platform.

If the Handle has been allocated for the control, the widgetset class is updated. Otherwise, control flags are updated to include the value wcfColorChanged.

The NotifyControls method is called to send the CM_PARENTCOLORCHANGED control message to the child controls.

## See also

TControl.Color |  | The background color for the control.
TControl.SetColor |  | Sets the value for the Color property.