TreeView

Button对TreeView所有节点的全选
IT技术笔记

Button对TreeView所有节点的全选

115 1

PRotected void Button1_Click(object sender, EventArgs e){for (int i = 0; i < this.TreeView1.Nodes.Count; i++)//循环根节点{if (TreeView1.Nodes[i].Checked == false)//判断是否被选中{TreeView1.Nodes[i].Checked = true;for (int j = 0; j < this.TreeView1.No…