TiComponent.Transparent

TiComponent See Also

Specifies whether the background behind the control shows through.

property
Transparent : Boolean;

Description

Use the Transparent property to specify whether the background behind the control shows through.

This feature utilizes a cached bitmap of the background behind the control when enabled to minimize the performance penalty. For controls that already use a cache background when transparency is disable, there is no performance penalty when enabling transparency because the control uses the transparency cache instead of the background cache.

Due to limitations in the Microsoft API for transparent controls, the following issues must be taken into account when implementing...

Background controls that change dynamically at runtime will cause flicker (Recommend that you only place static or semi-static controls behind transparent controls)

Controls can appear to disappear if the background control underneath it is moved. This is due to a bug in the Microsoft API, the API fails to send a repaint message to the foreground transparent control making it look like it has disappeared (Resizing the background control will make the transparent foreground controls reappear).

At design-time, it is recommend but not required that you leave the Transparent property set to FALSE. At run-time, set the Transparent property to TRUE when the Form/Dialog initializes. During design-time, the controls can appear to disappear if the background control underneath it is moved. Also, depending on the development environment, the background of the transparent controls can become solid white or black.

During run-time, if the background is changed, the transparent foreground control can disappear or its cached snapshot of the background can get out of sync with the actual background. Call the RepaintAll method of the control each time the background is changed to keep in sync.

Example

Delphi

iComponent.Transparent := True;

C++ Builder

iComponent->Transparent = True;

Note: Not all descendants implement this property.

Contents | Index | Previous | Next