Vcl.Controls.TWinControl.DoubleBuffered

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property DoubleBuffered: Boolean read GetDoubleBuffered write SetDoubleBuffered stored IsDoubleBufferedStored;

C++

__property bool DoubleBuffered = {read=GetDoubleBuffered, write=SetDoubleBuffered, stored=IsDoubleBufferedStored, nodefault};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TWinControl

Description

Determines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first.

When DoubleBuffered is false, the windowed control paints itself directly to the window. When DoubleBuffered is true, the windowed control paints itself to an in-memory bitmap that is then used to paint the window. Double buffering reduces the amount of flicker when the control repaints, but is more memory intensive.

When a windowed control is a dock site and has an associated dock manager, it must be double-buffered.

Note: Some controls, such as TRichEdit, can't paint themselves into a bitmap. For such controls, DoubleBuffered must be set to false. Use the DoubleBuffered property carefully (especially for the TCustomForm class), and only in specific cases, because it can break when drawing the child controls. Also, you should use the CanUseDoubleBuffering method with the DoubleBuffered property to check that double buffering is really enabled for control.

See Also

Code Examples