I have some code that I use to drag and drop from treeview to treeview, now I
want to adapt the code to drag and drop from listview to treeview. I am
having problems adapting the code nor can I find a good article on the web on
how to do this. I have attached below my source code that I have not touched.
Can anybody point out where I would need to make changes or an good article
on the net?
Dim NewNode As Windows.Forms.TreeNode
Dim imgIndex As Windows.Forms.TreeNode
If e.Data.GetDataPresent("System.Windows.Forms.TreeNo de", False) Then
Dim pt As Drawing.Point
Dim destinationNode As Windows.Forms.TreeNode
pt = CType(sender, Windows.Forms.TreeView).PointToClient(New
Drawing.Point(e.X, e.Y))
destinationNode = CType(sender,
Windows.Forms.TreeView).GetNodeAt(pt)
NewNode = CType(e.Data.GetData("System.Windows.Forms.TreeNod e"),
Windows.Forms.TreeNode)
If Not destinationNode.Equals(NewNode) Then
'now adding to the shs tree view
destinationNode.Nodes.Add(CType(NewNode.Clone,
Windows.Forms.TreeNode))
imgIndex = destinationNode
imgIndex.ImageIndex = 2
imgIndex.SelectedImageIndex = 2
'imgIndex.Tag = "U" & strStatus
destinationNode.Expand()
End If
End If