C#Windows窗体的TreeView排序后LabelEdit

编程入门 行业动态 更新时间:2024-10-23 07:24:35
本文介绍了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

本文发布于:2023-11-09 15:47:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1572770.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗体   Windows   LabelEdit   TreeView

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!