Dragging and dropping a TreeNode onto a ListBox
-
I have a TreeView on my form as well as a ListBox. I have an Artist, Album and Song class which each extend the TreeNode class. The ListBox holds a list of songs which will be copied to a removable device. Now what I want to do is be able to drag an artist node, album node or a song node onto the list box and have all the songs under the dropped node show up in the ListBox. I know I need to use the DragDrop, Drag Enter and/or DragLeave events but I don't know how.
-
I have a TreeView on my form as well as a ListBox. I have an Artist, Album and Song class which each extend the TreeNode class. The ListBox holds a list of songs which will be copied to a removable device. Now what I want to do is be able to drag an artist node, album node or a song node onto the list box and have all the songs under the dropped node show up in the ListBox. I know I need to use the DragDrop, Drag Enter and/or DragLeave events but I don't know how.
-
http://www.google.com/search?hl=en&q=drag+drop+C%23&btnG=Google+Search[^] That should get you started.
Ok I'm looking at this one: http://www.codeproject.com/KB/shell/dragdropharsha.aspx, but I don't know how to use the DragDrop event for an object.