treeview检查和取消选中节点 [英] treeview checking and unchecking nodes

查看:271
本文介绍了treeview检查和取消选中节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

dsdsd

解决方案

也许您应该透露问题并检查文档和示例对于
AfterCheck 事件:"在BeforeCheck或AfterCheck事件处理程序中设置TreeNode.Checked属性会导致事件多次引发,并可能导致意外行为。为了防止多次引发事件,
为事件处理程序添加逻辑,如果TreeViewEventArgs的Action属性未设置为TreeViewAction.Unknown"
,则只执行递归代码。


dsdsd

解决方案

Maybe you should divulge the problem and also check the documentation and sample for AfterCheck event: "Setting the TreeNode.Checked property from within a BeforeCheck or AfterCheck event handler causes the event to be raised multiple times and can result in unexpected behavior. To prevent the event from being raised multiple times, add logic to your event handler that only executes your recursive code if the Action property of the TreeViewEventArgs is not set to TreeViewAction.Unknown".


这篇关于treeview检查和取消选中节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆