Drag & Drop from within a Treeview 
Author Message
 Drag & Drop from within a Treeview

The subject is kind of misleading.  Drag & Drop is not my problem.  What I
need is a way to let a user move a node and all of it's children to another
node within the same treeview.  Just like moving folder in Explorer.  I know
that I can iterate through all of the source nodes children and dynamically
add them under the destination node but this is cumbersome and time
consuming.  I'm looking for a way to do something like this.

Dim newNode as Node

set newNode =  tvw.Nodes.Add(destinationNode.Index, tvwChild)
set newNode = sourceNode
tvw.Nodes.Remove sourceNode

Obviously this doesn't work (except for: tvw.Nodes.Remove sourceNode).

If anyone knows of a way around looping through all of the children of the
source node, I would appreciate it if you could share it with me.

Thanks in advance



Tue, 16 Oct 2001 03:00:00 GMT  
 Drag & Drop from within a Treeview
This sounds like something that I'm doing.  I use drag and drop in a
treeview and here is how I make the change.

Set myDragNode.Parent = TreeView1.DropHighlight

myDragNode is the node that was selected with in mouse down event.  The
DropHighlight is the node selected with the drag over event.



Tue, 16 Oct 2001 03:00:00 GMT  
 Drag & Drop from within a Treeview
Hi Nathan.  I seem to remember being able to 'move a node and all of it's
children to another node within the same treeview' with the sample I've
listed below.  I hope it provides you some assistance.

SAMPLE: Manipulating and Saving the Nodes in a TreeView Control
Article ID: Q172272
http://support.microsoft.com/support/kb/articles/q172/2/72.asp

'-------
galen



Tue, 16 Oct 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Drag & drop action within ListView and Treeview

2. Drag&Drop within TreeView control.

3. Drag & drop action within ListView and Treeview

4. Drag and Drop within Treeview question

5. Drag and Drop within treeview

6. Drag Drop Within TreeView

7. Drag and Drop within treeview

8. Drag & Drop with TreeView control

9. TreeView Drag & Drop

10. ole drag&drop of file from an activex/ treeview headache

11. TreeView + ListView +Drag&Drop

12. Treeview - Drag & Drop

 

 
Powered by phpBB® Forum Software