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

# TCustomHeaderControl.OnCreateSectionClass

Event handler signalled to get the class type used to create a new section for the header control.

## Declaration

Source position: comctrls.pp line 4113

`published property TCustomHeaderControl.OnCreateSectionClass : TCustomHCCreateSectionClassEvent read FOnCreateSectionClass write FOnCreateSectionClass;`

## Description

OnCreateSectionClass is a TCustomHCCreateSectionClassEvent property with the event handler signalled to get the class type for a new section on the control.

OnCreateSectionClass is signalled (when assigned) from the CreateSection method, and allows the class type for a new section to be determined. The variable SectionClass argument for the event handler is used to return the class type. The return value is used in CreateSection to create the collection item added to the Sections on the control.

If OnCreateSectionClass is not assigned, the THeaderSection class type is used.

OnCreateSectionClass is signalled at run-time when the Add or AddItem method in the Sections collection is called. OnCreateSectionClass is not signalled at design-time when the Object Inspector property editor is used to maintain the Sections property. The THeaderSection class type is always used at design-time as the item class for the Sections collection.

## See also

TCustomHeaderControl.CreateSection |  | Creates a new header section for the control.
TCustomHeaderControl.CreateSections |  | Creates the collection used to store header sections defined for the control.
THeaderSections.Add |  | Creates a new header section and adds it to the collection.
THeaderSections.AddItem |  | Adds the specified header section at the position specified in Index.
THeaderSections.Create |  | Constructor for the class instance.
TCustomHCCreateSectionClassEvent |  | Specifies the event handler signalled to get the class type for a new section on a THeaderControl instance.