参考这个:
void selectSpecificNode() {
ArrayList selectedNodes = new ArrayList();
selectChildren(treeList1.Nodes[0].Nodes[0], selectedNodes); treeList1.Selection.Set(selectedNodes);
}
void selectChildren(TreeListNode parent, ArrayList selectedNodes) {
IEnumerator en = parent.Nodes.GetEnumerator();
TreeListNode child;
while(en.MoveNext()) {
child = (TreeListNode)en.Current;
selectedNodes.Add(child);
if(child.HasChildren)
selectChildren(child, selectedNodes);
}
}