I tried to implement drag and drop in treeview. First I generate the root nodes, and then if I drag any item over the tree, I want to put it under the exact root nodes . I need something like
private void treeView1_DragOver(object sender, DragEventArgs e)
{
TreeNode tNode = FindNodeAtPoint(e.X, e.Y);
}
so from tNode I can find its root node and can populate it under this parent node.
can someone help me with findNodeAtPoint () function.
private TreeNode FindNodeAtPoint(int x, int y)
{
Point p = new Point(x, y);
p = PointToClient(p);
................
................
................
}
source
share