treeview检查和取消选中节点 [英] treeview checking and unchecking nodes
问题描述
也许您应该透露问题并检查文档和示例对于
AfterCheck 事件:"在BeforeCheck或AfterCheck事件处理程序中设置TreeNode.Checked属性会导致事件多次引发,并可能导致意外行为。为了防止多次引发事件,
为事件处理程序添加逻辑,如果TreeViewEventArgs的Action属性未设置为TreeViewAction.Unknown"。,则只执行递归代码。
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屋!