Question Move Treeview Items Up and Down

sputnik75043

Member
Joined
Aug 28, 2010
Messages
13
Programming Experience
Beginner
I've got a treeview populated and I have 2 buttons for UP and DOWN

I'd like to use the buttons to move the selected treeview item/node up or down based on the buttons click events. (inside parent node only)

I haven't been able to find anything specifically on how to do this on the net - -
does anyone have any tutorials or instructions/tips on how to accomplish this?
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,516
Location
Norway
Programming Experience
10+
You have to remove the TreeNode, then insert it again at index+/-1. You can get the Index from TreeNode and call its Remove method, and you must use the Insert method of the TreeNodeCollection it belongs to to add it back.
 
Top Bottom