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.T reeNode
Dim imgIndex As Windows.Forms.T reeNode
If e.Data.GetDataP resent("System. Windows.Forms.T reeNode", False) Then
Dim pt As Drawing.Point
Dim destinationNode As Windows.Forms.T reeNode
pt = CType(sender, Windows.Forms.T reeView).PointT oClient(New
Drawing.Point(e .X, e.Y))
destinationNode = CType(sender,
Windows.Forms.T reeView).GetNod eAt(pt)
NewNode = CType(e.Data.Ge tData("System.W indows.Forms.Tr eeNode"),
Windows.Forms.T reeNode)
If Not destinationNode .Equals(NewNode ) Then
'now adding to the shs tree view
destinationNode .Nodes.Add(CTyp e(NewNode.Clone ,
Windows.Forms.T reeNode))
imgIndex = destinationNode
imgIndex.ImageI ndex = 2
imgIndex.Select edImageIndex = 2
'imgIndex.Tag = "U" & strStatus
destinationNode .Expand()
End If
End If
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.T reeNode
Dim imgIndex As Windows.Forms.T reeNode
If e.Data.GetDataP resent("System. Windows.Forms.T reeNode", False) Then
Dim pt As Drawing.Point
Dim destinationNode As Windows.Forms.T reeNode
pt = CType(sender, Windows.Forms.T reeView).PointT oClient(New
Drawing.Point(e .X, e.Y))
destinationNode = CType(sender,
Windows.Forms.T reeView).GetNod eAt(pt)
NewNode = CType(e.Data.Ge tData("System.W indows.Forms.Tr eeNode"),
Windows.Forms.T reeNode)
If Not destinationNode .Equals(NewNode ) Then
'now adding to the shs tree view
destinationNode .Nodes.Add(CTyp e(NewNode.Clone ,
Windows.Forms.T reeNode))
imgIndex = destinationNode
imgIndex.ImageI ndex = 2
imgIndex.Select edImageIndex = 2
'imgIndex.Tag = "U" & strStatus
destinationNode .Expand()
End If
End If