Topic: List index out of bounds on Tree...
When there are no child nodes I get "List index out of bounds" while trying to add a node to tree.
Here is the script causing the issue:
procedure frmBMTree_OnClose (Sender: TObject; Action: string);
begin
If Form1.TreeView2.RowCount <> 0 then
begin
form1.TreeView2.collapseall;
form1.TreeView2.expandnode(form1.TreeView2.selectedrow);
form1.TreeView2.Expanded[form1.treeview2.selectedrow] := true;
end;
end;
Error pointing to the following script line:
form1.TreeView2.expandnode(form1.TreeView2.selectedrow);
is there a way to trap it?
God... please help me become the person my dog thinks I am.