Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是这样做的:
myTreeView.Nodes[foo] = newTreeNode.Clone(); // this doesn't work
我想知道,如何正确地做到这一点?
编辑:我正在考虑删除旧的并插入新的树节点。
尝试这个:
TreeNode node = myTreeView.Nodes[foo]; int index = myTreeView.Nodes.IndexOf(node); myTreeView.Nodes.RemoveAt(index); myTreeView.Nodes.Insert(index, newTreeNode);