By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,710 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,710 IT Pros & Developers. It's quick & easy.

Help with drag drop from listview to treeview control

P: n/a
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

Nov 11 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.