ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   moving treeview node (https://www.excelbanter.com/excel-programming/419175-moving-treeview-node.html)

Ernst

moving treeview node
 
Hi experts,

From Stephen Bullens dragdropexample I learned how to move nodes in a
treeview using drag and drop in the treeview.
All I have to do is give a node a new parentnode.
This code is used to do this:

Set moDragItem.Parent = oParent

When I do this the draged node becomes the first childnode of its new
parent.
When I add a node it becomes the last childnode of the parent.

I want to move a node to a specific position between other childnodes, by
drop while pressing the control-button.

I tied this with the following code:

Set moDragItem.Next= oParent
or
Set moDragItem.Previous= oParent
or
Set oParent.Previous= moDragItem
or
Set oParent.Next= moDragItem

None gave me the expected result.

Because the childnodes represent different types, it is not an option to add
a node en rename alle the childnodes.
Does anyone have a solution to this issue?

Kind reagrds Ernst



All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com