本文介绍了C#Windows窗体的TreeView排序后LabelEdit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我尝试诉诸节点放置在合适的位置更新的项目。我在这会导致一个无限循环AfterLabelEdit事件处理函数调用的.sort做到这一点。
After a node's label is edited in the tree I try to resort the nodes to place the updated item in the right position. I do this by calling .Sort in AfterLabelEdit event handler which causes an infinite loop.
我怎么能诉诸节点的树状标签被更改后?
How can I resort the nodes in a treeview after a label has been changed?
推荐答案使用BeginInvoke的:
Use BeginInvoke:
delegate void sort(); private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) { treeView1.BeginInvoke(new sort(treeView1.Sort)); }更多推荐
C#Windows窗体的TreeView排序后LabelEdit
发布评论