Topic: Treeview collapse
The following solution you have kindly provided returns "List index out of bound".
Not sure but I guessing that it occurs when there are only top level nodes, no child nodes.
procedure Form2_OnClose (Sender: TObject; Action: string); begin form1.treeview1.collapseall; form1.treeview1.expandnode(form1.treeview1.selectedrow); form1.treeview1.Expanded[form1.treeview1.selectedrow] := true; end;
God... please help me become the person my dog thinks I am.