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

# TEndDragEvent

The type of an OnEndDrag handler.

## Declaration

Source position: controls.pp line 503

`type TEndDragEvent = procedure(`
`Sender: TObject;`
`Target: TObject;`
`X: Integer;`
`Y: Integer`
`) of object;`

## Arguments

`Sender` |  | The dragged control.
`Target` |  | The drop target (control), or Nil if cancelled.
`X` |  | The mouse coordinate, in client coordinates if dropped, else in screen coordinates.
`Y` |  | The mouse coordinate, in client coordinates if dropped, else in screen coordinates.

## Description

An OnEndDrag event is sent for a dragged control, when the drag operation is finished. This happens regardless of whether the operation was drag-drop or drag-dock, and whether the operation ended with a drop or was cancelled.

Check for an unassigned value in Target to distinguish between a drop and a cancelled operation (Nil).

## See also

TDragDropEvent |  | The type of an OnDragDrop notification handler.
TDockDropEvent |  | The type of an OnDockDrop handler.