1) Collapse TreeView using the FullCollapse method
TreeView1.FullCollapse;
2) To select (highlight) a Node assign the Selected property
TreeView1.Selected:=TreeView1.Items[NodeIndex];
3) Expand the selected Node using the Expand method
TreeView1.Items[NodeIndex].Expand(True);
source share