Link to home
Start Free TrialLog in
Avatar of pede
pede

asked on

Change .text on BeforelabelEdit

Hi, Im trying to change the text of a node (in a TreeView), just before the user starts to edit it. Imagine the text of the node is "Products (100)". When the user edits this nodes text, he's only supposed to edit the "products" text, not the "(100)". That is an autogenerated text I add.

This little sample shows the problem:

private void treeview_BeforeLabelEdit(object sender, System.Windows.Forms.NodeLabelEditEventArgs e)
{
  ((TreeNode)e.Node).Text = "TEST";
}

The text "TEST" is never shown, the user gets to edit the text that was in the label, before this event. Is there any wordaround for this?

Thanks in advance!

/Pede

ASKER CERTIFIED SOLUTION
Avatar of ErikPhilips
ErikPhilips
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial