当前位置:编程学习 > C#/ASP.NET >>

DotNetBar for Windows Forms AdvTree 如何实现多选


 

        //节点check状态改变
        private void c_smsuser_AfterCheck(object sender, AdvTreeCellEventArgs e)
        {
           DevComponents.AdvTree.Node pnode = this.c_smsuser.GetNodeAt(e.Cell.Bounds.Location.X, e.Cell.Bounds.Location.Y);

            int i = 0;
            foreach (DevComponents.AdvTree.Node tt in pnode.Nodes)
            {
                if (tt.Checked == true)
                {
                    i++;
                }
            }
            if (i == 0)
            {
                e.Cell.Parent.CheckState = System.Windows.Forms.CheckState.Unchecked;
            }
            else if (i == pnode.Nodes.Count)
            {
                e.Cell.Parent.CheckState = System.Windows.Forms.CheckState.Checked;
            }
            else
            {
                e.Cell.Parent.CheckState = System.Windows.Forms.CheckState.Indeterminate;
            }
            ClsOther.ShowMessageBoxMsg(e.Cell.Text + "|" + e.Cell.Checked.ToString() + "|");
            return;


AdvTree 实现多选 如果有一个子节点没有变成Indeterminate样式   
这样写会有死循环   说要在写个函数调用到_AfterCheck事件里面   怎么写  求指教   Windows C
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,