///
/// 设置TreeView选中节点
///
///
/// 选中节点文本
private void SelectTreeView(TreeView treeView,
string selectStr)
{
treeView.Focus();
for (
int i =
0; i < treeView.Nodes.Count; i++)
{
for (
int j =
0; j < treeView.Nodes[i].Nodes.Count; j++)
{
if (treeView.Nodes[i].Nodes[j].Text == selectStr)
{
treeView1.SelectedNode = treeView.Nodes[i].Nodes[j];
//选中
//treeView.Nodes[i].Nodes[j].Checked = true;
treeView.Nodes[i].Expand();
//展开父级
return;
}
}
}
}