I am trying to adapt some code that I have where I drag and drop from two
treeview controls. Now I want to drag and drop from a listview to a treeview.
Whatever I do does not work and I cannot find any good articals on the net on
how to do so. I have attached my original code for the two treeview
controls. Can anybody point out where I need to make changes?
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