473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Help with drag drop from listview to treeview control

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
0 2789

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: fgh | last post by:
Hello, two questions please: 1) In a treeview, I want to display folders like it is done in Windows Explorer. Do I have to do this manually or can I set something up in VS.NET 2003? 2) Most...
0
by: Plumer | last post by:
Hello everyone, Yesterday I posted a message about implementing drag & drop in a TreeView control. I'm having real difficulty getting this to work -- the process seems to be incredibly...
1
by: emferrari | last post by:
Hi everybody I have two treeviews, one of them is only to receive items dragged from the treeview1. I want to know how to drag a full node information to the treeview2. I know how to do that...
1
by: Kelvin Leung | last post by:
As title If it can, any web-site and sample I can download Thanks a lot
2
by: Yoshitha | last post by:
Hi In my application am using list box and treeview controls list box contains the files and the treeview contains files,folderrs and subfolders. I'll select a file from listbox and drag it and...
3
by: Kelvin Leung | last post by:
Hi I use Drag and Drop between 2 TreeView Control under VB.Net But I found that it cannot work when I add sub-class for each node Is it drag and drop method cannot work when the node with...
3
by: VB Programmer | last post by:
In VB.NET 2005 (winform) any sample code to drag & drop items between 2 listboxes? Thanks!
0
by: jawilson | last post by:
Hello, I am trying to use drag-n-drop for a listview control in my program. I created a new listview control class (just call it MyListView) that inherits from ListView, and creates a few new...
1
by: =?Utf-8?B?QW5kcmV3?= | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.