It is very late to answer this question, but here is another solution:
1) Remove the part you want the user to not edit the node label right before calling BeginEdit ()
2) In AfterLabelEdit () set the text node as you want and set NodeLabelEditEventArgs.CancelEdit = true so that the text user input does not replace the text that you set
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node == null) return; e.Node.Text = e.Node.Text.Substring(3, e.Node.Text.Length - 3); e.Node.BeginEdit(); } private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e) { e.Node.Text = "S :" + e.Label; e.CancelEdit = true; }
source share