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

TCustomLabel.Color

Sets the color used for the background of the control.

Declaration

Source position: stdctrls.pp line 1615

public property TCustomLabel.Color : TColor
  default clNone;

Description

The default value for the property is clNone in TCustomLabel. This value is used because labels, by default, are transparent in the LCL. Please note that this differs from the Delphi VCL where the default value for Transparent is False.

Changing the value in Color causes ControlStyle flags to be updated to include or exclude the value csOpaque as needed for the new property value. When set to clNone, the csOpaque flag is excluded from ControlStyle. Other values cause csOpaque to be included in ControlStyle.

Color is updated when a new value is assigned to the Transparent property. When Transparent is set to True, clNone is assigned to Color. When Transparent is set to False and color contains clNone, Color is changed to clBackground.

Values in Color and Font are used when the background and text for the control are drawn in the Paint method. Use the Font property to assign the typeface and color used for the text displayed on the control.

See also

TCustomLabel.Paint

  

Performs actions needed to draw the control on its Canvas.

TCustomLabel.Transparent

  

Indicates whether the viewer can see through the control.

TControl.Color

  

The background color of the control.

TControl.Font

  

The font to be used for text display in this control.

TControl.ControlStyle

  

Contains style flags which control the features or behaviors enabled for the control.