IDimensionViewer.DropTargetNode

Syntax

DropTargetNode: Integer;

Description

The DropTargetNode property determines the component node, over which the user is currently dragging another node.

Comments

It is used for Drag&Drop mechanism setup. Assigning a value to the property results in node selection.

It is relevant only for the DimensionTree component.

Example

Executing the example requires a form with the Button1 button, the DimensionTree component named DimensionTree1 and the UiDimension component that is a data source for DimensionTree1. The Drag&Drop mechanism is enabled for DimensionTree1.

Sub DimensionTree1OnDragOver(Sender: Object; Args: IDragEventArgs);
Var
    Node: Integer;
Begin
    Node := DimensionTree1.GetItemAt(Args.Point);
    If Node <> -1 Then
        DimensionTree1.DropTargetNode := Node;
    End If;
    Args.Effect := DragDropEffects.Move;
End Sub DimensionTree1OnDragOver;

After executing the example, when dragging any node in the DimensionTree1 component, the node being dragged becomes selected.

See also:

IDimensionViewer