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

TWinControl.PaintControls

Paints all child controls which do not have a Handle as part of their Parent.

Declaration

Source position: controls.pp line 2198

protected procedure TWinControl.PaintControls(

  DC: HDC;

  First: TControl

);

Arguments

DC

  

The device context usable for painting child controls.

First

  

First of the controls in Controls[], which remain to paint.

Description

Controls which do not descend from TWinControl have no handle of their own; they are repainted when the parent control is redrawn.

No actions are performed in the method when the device context in DC is unassigned (0), the Handle has not been allocated for the control, or an internal TFPList has not been created to store the child controls in the Controls property.

PaintControls tries to locate and paint controls (starting with the control in First) not derived from TWinControl. When First is omitted (Nil) or not found in the internal list, all child controls in the list are examined. The control must be Visible and within the visible client area on the Parent to be painted.

Each eligible control is positioned on the device context using the Left and Top properties for the control. Its clipping rectangle is copied to the device context, and an LM_PAINT message is performed on the DC to redraw the parent control.

The ControlState property is updated prior to and following the paint operation for each child control to include or exclude the csPaintCopy value.

PaintControls is called from the PaintHandler method, and occurs when the WMPaint method handles an LM_PAINT message for a control.


Version 3.2 Generated 2024-02-25 Home