- Call TV_Drag() from the TreeView's G-Label when A_GuiEvent contains "D" or "d". A line will show across the TreeView while holding the button to indicate the destination where the selected node will be dropped with its children.
- If you point the mouse cursor to the half bottom part of the node text it will be dropped as a child of the pointed node. If you point it to the upper part it will drop it as sibling right below the pointed node.
- TV_Drag() returns the target node id (if valid) which you can use to call TV_Drop() and effectively move the selection. Alternatively you can set AutoDrop option on as a shorthand.
- Separating the Drag and Drop calls allows to check if the returned destination is a valid node to drop in as well as setting GuiControl, -Redraw to avoid flickering.
- TV_Drop() may be called directly to move or copy nodes programmatically. You may pass the TreeView control's hwnd to keep icons and set Copy parameter to true if you want to copy nodes instead of moving.
See also LV_Rows