Vcl.Controls.TControl.OnDragOver

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnDragOver: TDragOverEvent read FOnDragOver write FOnDragOver;

C++

__property TDragOverEvent OnDragOver = {read=FOnDragOver, write=FOnDragOver};

Properties

Type Visibility Source Unit Parent
event protected
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TControl

Description

Occurs when the user drags an object over a control.

Use an OnDragOver event to signal that the control can accept a dragged object so the user can drop or dock it.

Within the OnDragOver event handler, change the Accept parameter to False to reject the dragged object. Leave Accept as True to allow the user to drop or dock the dragged object on the control.

To change the shape of the cursor, indicating that the control can accept the dragged object, change the value of the DragCursor property for the control before the OnDragOver event occurs.

The Source is the object being dragged, the Sender is the potential drop or dock site, and X and Y are screen coordinates in pixels. The State parameter specifies how the dragged object is moving over the control.

Note: Within the OnDragOver event handler, the Accept parameter defaults to True. However, if an OnDragOver event handler is not supplied, the control rejects the dragged object, as if the Accept parameter were changed to False.

OnDragOver is an event handler of type TDragOverEvent.

See Also

Code Examples