ITreeListNode.IsDropTarget

Syntax

IsDropTarget: Boolean;

Description

The IsDropTarget property determines whether any node is passing over the current node at the moment.

Comments

It is used to set up the Drag&Drop mechanism. When the property is set to True, the current node is selected.

Example

Executing the example requires a form with a button named Button1 on the form 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
        Node.IsDropTarget := True;
    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:

ITreeListNode