Hi,
maybe you can use this topic as a starting point:
http://delphi.about.com/od/vclusing/l/aa010703a.htm
Within your treeview you have to identify which user(TreeViewNode) is online/offline and depending
on this info you have to
delete the corresponding node from one parent node (_online) and
add
a new node to the other parent node (_offline) - or vice versa...
Regards,
Steku