In the process of program development we often use the TreeView, but also often to modify the name of the node. The node name is modified to update the database in a timely manner. Then the question is, how do you get the updated value of node? I tried a lot of methods to finally analyze the AfterLabelEdit event of the TreeView node name modification. There are two parameters in the event such as code sender and E.
private void Treeview2_afterlabeledit (object sender, NodeLabelEditEventArgs e)
{
}
The E in the code has two values, e.lable and E.node. Lable is the currently modified value, node is the currently modified contact.
Suppose that the name of a node before the modification is "NODE01", we want to modify the name to "Node 01", then we have three ways to verify.
treeview1.selectednode.text--"NODE01
e.node.text--"NODE01
e.lable--"Node 01
When you change a node to an edit state and the content is not modified, the value of E.lable is NULL.
C # WinForm TreeView node (node) rename or get node modified value