i have this treeview 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 is when a user is online he will be deleted from offline node and moved to the Online node . example for user2 and user4 , any help please
many thanks
Under the assumption that you are using the built in TTreeView
, then you can call the TTreeNode.MoveTo
method.
user2node.MoveTo(onlineNode, naAddChild);
If a comment you ask:
How can I access the offline child nodes in code?
Like so:
node := offlineNode.getFirstChild;
while Assigned(node) do
begin
DoSomething(node);
node := node.getNextSibling;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With