ITreeControl.DropTargetNode

Syntax

DropTargetNode: ITreeListNode;

Description

The DropTargetNode property determines the node of the component, over which user is dragging another node at the moment.

Comments

It is used to set up the Drag&Drop mechanism. Setting the value causes node selection.

Example

Executing the example requires a form, a button named Button1 on it and the TreeList component named TreeList1. The Drag&Drop mechanism is activated for TreeList1.

Sub TreeList1OnDragOver(Sender: Object; Args: IDragEventArgs);

Var

Node: ITreeListNode;

Begin

Node := TreeList1.GetItemAt(Args.Point);

If Node <> Null Then

TreeList1.DropTargetNode := Node;

End If;

Args.Effect := DragDropEffects.Move;

End Sub TreeList1OnDragOver;

After executing the example when any node is dragged in the TreeList1 component, the node, over which the dragging is executed, is selected.

See also:

ITreeControl