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

TWinControl.DoubleBuffered

Allows to reduce flicker in the painting of the control.

Declaration

Source position: controls.pp line 2180

public property TWinControl.DoubleBuffered : Boolean
  read FDoubleBuffered
  write FDoubleBuffered
  default False;

Description

Paint requests typically are buffered in the message queue. When a paint message arrives, all elements of the control are drawn onto the screen, according to their type, style, state and content.

This can cause flicker, when stacked controls wipe out preceding paintings, e.g. when unchanged text is erased from the screen before it is painted again, when it takes some time to retrieve the text of list entries, or wrapping long text at the current control boundaries. Owner-drawing also can cause noticeable flicker.

To reduce such flicker, DoubleBuffered controls use a buffer bitmap into which all painting is redirected. When the bitmap has been updated, a paint request is queued for the control. When that paint request is received again, the prepared bitmap is output in one fast BitBlt transfer, eliminating any flicker.

All this happens automatically, when DoubleBuffered is set to True, no further changes are required in application or custom control code.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.