遍历treeView的所有节点
public void GetNode(TreeNodeCollection tc)
{
foreach(TreeNode TNode in tc)
{
MessageBox.Show(TNode.Text.tostring());
GetNode(TNode.Nodes);
}
}
//调用
TreeNodeCollection tc=treeView1.Nodes;
GetNode(tc);