Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if the user is dragging nodes from another virtual treeview?

In the OnDragOver or OnDragDrop events, how to check if the user is dragging nodes of the same Virtual Treeview or of another?

DragType is dtVCL

like image 958
Edwin Yip Avatar asked Jan 31 '26 03:01

Edwin Yip


1 Answers

In both events, you have arguments Sender and Source. Sender is the component sending the event, that is the tree above which the mouse is flying, the drag receiver. The Source is the tree from which the drag is coming.

You can cast the Sender or Source to the actual tree you use.

Memo1.Lines.Add(TVirtualStringTree(Sender).Name);
Memo1.Lines.Add(TVirtualStringTree(Source).Name);
like image 195
fpiette Avatar answered Feb 02 '26 22:02

fpiette