Sign in Join
FPDoc Onlineexperiment

TCustomLabel.Transparent property

Member of TCustomLabelprotectedIn unit StdCtrls

Indicates whether the viewer can see through the control.

Declaration

pascal
property Transparent: Boolean read GetTransparent write SetTransparent default True;

Description

When Transparent is set to False, the enclosing rectangle for the control is filled with the background Color for the label. When set to True, Color is not used to fill the background for the control and the underlying control is visible.

The property value is True when csOpaque has not been included in the style flags for the control. Changing the value for the property causes ControlStyle to be updated. When set to True, csOpaque is removed from ControlStyle. When set to False, csOpaque is included in ControlStyle. The control is redrawn when a new value is assigned to the property.

The default value for Transparent in the LCL is True. This differs from the default value in the Delphi VCL.

Values in Transparent and Color are used in the Paint method when the background and text for the control are drawn. When Transparent is False and Color has a value other than clNone, a solid brush is used to fill the display area with the value in Color.

Modified in LCL version 3.0. Transparent is no longer toggled when Color is changed. Its value is independent of Color.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.