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

# TCustomHeaderControl.PaintSection

Paints the specified header section to the Canvas for the control.

## Declaration

Source position: comctrls.pp line 4094

`public procedure TCustomHeaderControl.PaintSection(`
`Index: Integer`
`); virtual;`

## Arguments

`Index` |  | Ordinal position for the header section rendered in the method.

## Description

PaintSection is a method used to paint the specified header section to the Canvas for the THeaderControl control.

Index contains the ordinal position for the THeaderSection instance in the Sections collection. No actions are performed in the method if the header section is not Visible.

PaintSection draws the header section using the Left and Right properties in the THeaderSection instance. The value in its State property is used to render the section by calling methods in ThemeServices. When Images have been assigned in the control, and the header section has an assigned image index, it is drawn to the Canvas. When Text contains a non-empty value, it is also rendered to the Canvas using the DrawText method in ThemeServices.