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

# THeaderSection

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements a section displayed on a TCustomHeaderControl / THeaderControl instance.

## Declaration

Source position: comctrls.pp line 3957

`type THeaderSection = class(TCollectionItem)`
`protected`
`function GetDisplayName; override;` |  | Gets the value for the DisplayName property.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`procedure Assign(); override;` |  | Implements object persistence for the THeaderSection type.
`property Left: Integer; [r]` |  | The position of the left boundary of the section.
`property Right: Integer; [r]` |  | The position of the right boundary of the section.
`property State: THeaderSectionState; [rw]` |  | State - whether normal, hot (i.e. mouse hovers over it ready to be selected) or pressed (selected).
`property OriginalIndex: Integer; [r]` |  | Index position which does not change when the user reorders the sections on a header control.
`published`
`property Alignment: TAlignment; [rw]` |  | Alignment - whether text is to be left or right justified or centered.
`property ImageIndex: TImageIndex; [rw]` |  | Ordinal position for the image displayed for the header section.
`property MaxWidth: Integer; [rw]` |  | Maximum width in pixels allowed for the header section.
`property MinWidth: Integer; [rw]` |  | Minimum width in pixels allowed for the header section.
`property Text: TCaption; [rw]` |  | The text displayed on the header section.
`property Width: Integer; [rw]` |  | Total width in pixels for the text and image on the header section.
`property Visible: Boolean; [rw]` |  | Indicates if the section is visible in the header control.
`end;`

## Inheritance

`THeaderSection` |  | Implements a section displayed on a TCustomHeaderControl / THeaderControl instance.
`TCollectionItem`
?
`TObject`

## Description

THeaderSection is a TCollectionItem descendant which implements a section displayed on a TCustomHeaderControl / THeaderControl instance. THeaderSection is the type added and maintained in the THeaderSections collection, and used in the TCustomHeaderControl.Sections property.

THeaderSection has properties which identify its visual characteristics. This includes the text displayed for the section, its alignment, minimum and maximum widths, and an index for an optional image. Other properties contain run-time information about the section, including its left and right coordinates and its display state.

THeaderSection instances are normally created at design-time and edited using the IDE object inspector. They can be created at run-time using methods in the THeaderSections collection, and edited in code.

## See also

THeaderSections |  | Implements a collection for sections in a TCustomHeaderControl control.
TCustomHeaderControl.Sections |  | Sections - the short segments of the header separated by vertical bars that function as the elementary selection units of the header.