Delphi Treeview node manipulation

I have this tree structure structure:

Users |_Online |_Offline |_ user1 --> current status offline |_ user2 --> current status Online |_ user3 --> current status offline |_ user4 --> current status online 

what I want to do, when the user is online, he will be removed from the stand-alone node and moved to the online node. example for user2 and user4, any help please

thank you very much

+4
source share
1 answer

Assuming you are using the built-in TTreeView , you can call the TTreeNode.MoveTo method.

 user2node.MoveTo(onlineNode, naAddChild); 

If you comment on the comment:

How can I access autonomous child nodes in code?

Same:

 node := offlineNode.getFirstChild; while Assigned(node) do begin DoSomething(node); node := node.getNextSibling; end; 
+8
source

All Articles