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

# TCustomHeaderControl.SectionDrag

Signals the OnSectionDrag event handler (when assigned and enabled).

## Declaration

Source position: comctrls.pp line 4072

`protected function TCustomHeaderControl.SectionDrag(`
`FromSection: THeaderSection;`
`ToSection: THeaderSection`
`):Boolean; virtual;`

## Arguments

`FromSection` |  | Section to be dragged on the header control.
`ToSection` |  | Section that is the potential drop target for the drag operation.

## Function result

True if the drag operation can be performed the selected section.

## Description

SectionDrag is a Boolean function used to signal the OnSectionDrag event handler when a drag operation is started for a section on the header control. The return value is True if the DragReorder property is enabled, and the OnSectionDrag event handler has been assigned and allows the drag operation for the specified source and destination sections.

No actions are performed in the method if DragReorder is set to False.

Update the AllowDrag argument in the TSectionDragEvent handler to indicate whether the section in FromSection can be dragged to the position for the section in ToSection.

SectionDrag is called from the MouseMove method when a Shift+Left mouse button event is detected on one of the Sections for the control.

## See also

TCustomHeaderControl.OnSectionDrag |  | Event handler signalled to determine whether a header section can be dragged and dropped at a new position on the control.
TCustomHeaderControl.DragReorder |  | Enables or disables reordering of header sections on the control using drag and drop.
TCustomHeaderControl.Sections |  | Sections - the short segments of the header separated by vertical bars that function as the elementary selection units of the header.
TCustomHeaderControl.MouseMove |  | Handler for MouseMove events.
TSectionDragEvent |  | TSectionDragEvent - generic event handling method for dragging a header section.