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

# THeaderControl

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

THeaderControl, a header strip of user-designed sections which allow selection of pages or actions.

## Declaration

Source position: comctrls.pp line 4120

`type THeaderControl = class(TCustomHeaderControl)`
`published`
`property Align: TAlign;` |  | Specifies the placement of the control on its Parent control.
`property Anchors: TAnchors;` |  | The set of anchor definitions for this control.
`property BiDiMode: TBiDiMode;` |  | Indicates whether text controls use in bi-directional reading.
`property BorderWidth: TBorderWidth;` |  | Width of the Border around the control; default is zero.
`property BorderSpacing: TControlBorderSpacing;` |  | Determines the inner and outer border spacing for this control.
`property DragCursor: TCursor;` |  | The cursor shape shown during a drag operation.
`property DragKind: TDragKind;` |  | Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock.
`property DragMode: TDragMode;` |  | Determines how a drag operation is started for the control.
`property Enabled: Boolean;` |  | Determines whether the control responds to mouse or keyboard input.
`property Font: TFont;` |  | The font to be used for text display in this control.
`property Images: TCustomImageList;` |  | Contains bitmaps displayed on the header sections for the control.
`property ImagesWidth: Integer;` |  | Specifies the width for Images displayed in the header control.
`property Constraints: TSizeConstraints;` |  | Contains the minimum and maximum Width and Height for the control.
`property Sections: THeaderSections;` |  | Sections - the short segments of the header separated by vertical bars that function as the elementary selection units of the header.
`property ShowHint: Boolean;` |  | Enables Hint display for the control.
`property ParentBiDiMode: Boolean;` |  | Indicates whether the BiDiMode settings in the Parent control are used.
`property ParentFont: Boolean;` |  | Indicates if the Font from the Parent control is used in the control.
`property ParentShowHint: Boolean;` |  | If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.
`property PopupMenu: TPopupMenu;` |  | A context-sensitive menu that pops up when the right mouse button is clicked over this control.
`property Visible: Boolean;` |  | Allows the control, and all of its children, to be displayed or hidden.
`property OnContextPopup: TContextPopupEvent;` |  | Invoked when a context-sensitive pop-up menu is requested.
`property OnCreateSectionClass: TCustomHCCreateSectionClassEvent;` |  | Event handler signalled to get the class type used to create a new section for the header control.
`property OnDragDrop: TDragDropEvent;` |  | Event handler signalled when an object is dropped onto the control.
`property OnDragOver: TDragOverEvent;` |  | Event handler signalled when a control is dragged over the control instance.
`property OnEndDock: TEndDragEvent;` |  | Event handler signalled for the end of a drag-dock operation.
`property OnEndDrag: TEndDragEvent;` |  | Event handler signalled for the end of a drag-drop operation.
`property OnMouseDown: TMouseEvent;` |  | Event handler signalled when a mouse down event is handled for the control.
`property OnMouseEnter: TNotifyEvent;` |  | Event handler signalled when the mouse pointer has entered the control.
`property OnMouseLeave: TNotifyEvent;` |  | Event handler signalled when the mouse pointer has left the control.
`property OnMouseMove: TMouseMoveEvent;` |  | Event handler signalled when the mouse pointer is moved in the control.
`property OnMouseUp: TMouseEvent;` |  | Event handler signalled when a mouse up event is handled for the control.
`property OnMouseWheel: TMouseWheelEvent;` |  | Event handler for mouse wheel turned.
`property OnMouseWheelDown: TMouseWheelUpDownEvent;` |  | Event handler signalled for a downward movement of the mouse wheel.
`property OnMouseWheelUp: TMouseWheelUpDownEvent;` |  | Event handler signalled for an upward movement of the mouse wheel.
`property OnMouseWheelHorz: TMouseWheelEvent;` |  | Event handler signalled for a horizontal movement of the mouse wheel.
`property OnMouseWheelLeft: TMouseWheelUpDownEvent;` |  | Event handler signalled for a leftward movement of the mouse wheel.
`property OnMouseWheelRight: TMouseWheelUpDownEvent;` |  | Event handler signalled for a rightward movement of the mouse wheel.
`property OnResize: TNotifyEvent;` |  | Notification handler for a resize of the control.
`property OnSectionClick: TCustomSectionNotifyEvent;` |  | Event handler signalled when a mouse click event occurs in a section header on the control.
`property OnSectionResize: TCustomSectionNotifyEvent;` |  | Event handler signalled when a resize operation for a header section has been completed.
`property OnSectionTrack: TCustomSectionTrackEvent;` |  | Event handler signalled when drag tracking/resizing is activated for the selected header section on the control.
`end;`

## Inheritance

`THeaderControl` |  | THeaderControl, a header strip of user-designed sections which allow selection of pages or actions.
`TCustomHeaderControl` |  | TCustomHeaderControl - base class for THeaderControl, a header strip of user-designed sections which allow selection of pages or actions.
`TCustomControl` |  | The base class for windowed controls which paint themselves.
`TWinControl` |  | Implements a windowed control which can contain other child controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

THeaderControl, a header strip of user-designed sections which allow selection of pages or actions.

THeaderControl offers a widget that could be placed along the edge of a Panel or Form allowing a highly customized mechanism for selection. However there are no intrinsically associated display areas and it is the developer's responsibility to supply an index associated with the selection from the THeaderControl and determine what action is to occur or what is to be displayed in any attached Panel or Form.

THeaderControl is used by selecting its icon from the Common Controls tab of the IDE Component Palette and placing it on the Form in the desired position. It may be convenient to dock it with a Form or Panel whose properties it is to be used for controlling.

After size, position, docking, alignment, anchoring etc have been performed using the Object Inspector or Form Designer, the Sections of the Header can be created by selecting the control, right-clicking with the mouse and choosing 'Section Editor'. A Stringlist editor will pop up with options to add, delete or move entries up or down the list. Each entry is given an Index which can be used in OnClick event handlers to determine the action to be taken when that section is selected at run-time.

## See also

Using Multi-Page Controls |  | MultiPageControls - controls that offer a selection of alternative pages for display.