zoukankan      html  css  js  c++  java
  • TreeView只能选中一个节点

    让TreeView的所有节点包括父节点和子节点,有且仅有一个能被选中:

            private void checkAllNodes(TreeNode pNode,bool nodeChecked,TreeNodeCollection col)
            {
                if (nodeChecked == true)
                {
                    foreach (TreeNode node in col)
                    {
                        if (node != pNode)
                        {
                            node.Checked = !nodeChecked;
                        }
                        if (node.Nodes.Count > 0)
                        {
                            // If the current node has child nodes, call the checkAllNodes method recursively.
                            this.checkAllNodes(pNode,nodeChecked, node.Nodes);
                        }
                       
                    }
                }
            }

    调用: this.checkAllNodes(e.Node,e.Node.Checked, treeView1.Nodes);

  • 相关阅读:
    beini破解无线
    commview for wifi 破解无线
    取代奶瓶Minidwep-gtk 破 WPA 全攻略
    CDLinux环境下WiFi密码破解
    WiFi密码破解CDlinux
    如何在vue.js渲染完界面之后再调用函数
    Flex布局备忘
    IDEA基本配置
    Flutter环境搭建踩坑-Android sdkmanager tool not found
    Git操作-DevOps
  • 原文地址:https://www.cnblogs.com/qingwufeiyang/p/3992237.html
Copyright © 2011-2022 走看看