Sign in Join
FPDoc Onlineexperiment

TCustomHeaderControl.CreateSection function

Member of TCustomHeaderControlprotectedIn unit ComCtrls

Creates a new header section for the control.

Declaration

pascal
function CreateSection: THeaderSection; virtual

Function result

THeaderSection instance created in the method.

Description

CreateSection is a THeaderSection function used to create a new value in the Sections collection for the control. The return value contains an instance of THeaderSection (or a descendant class) created in the method with the Sections collection as the owner of the item.

The OnCreateSectionClass event handler is signalled (when assigned) at run-time to allow a custom item class to be used to create the collection item. The handler returns the class type instantiated in the method. By default, the class type is THeaderSection but can be overridden in OnCreateSectionClass to use a THeaderSection descendant.

OnCreateSectionClass is not signalled at design-time; THeaderSection is always used as the item class when added to the Sections property using the Object Inspector property editor.

CreateSection is called from the AddItem method in the Sections (THeaderSections) collection, and occurs when an item class instance is not passed as an argument to the collection method.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.