<br>the code Im using is the following<br><br><br>tvw = THISFORM.tvwMain && tvwMain is the treeview control<br><br> If tvw.SelectedItem.Children > 0 &&' There are children.<br><br> && Get first child's text, and set N to its index value.<br> strC = tvw.SelectedItem.Child.Text <br> N = tvw.SelectedItem.Child.Index<br><br> && While N is not the index of the child node's last sibling, get next sibling's text.<br> do While N <> tvw.SelectedItem.Child.LastSibling.Index<br> mkey = tvw.Nodes(N).Next.key<br> N = tvw.Nodes(N).Next.Index<br> tvw.nodes.remove(mkey)<br> enddo<br> Else &&' There are no children.<br> Messagebox(tvw.SelectedItem.Text + " has no children",64,'Attention')<br> EndIf<br><br>somehow the first 1 or 2 nodes always remain<br><br>Thanks<br>