Change TreeNode.Text before editing

G

Guest

hi ng,

i have a problem when i try to change the text property of
a TreeNode just before the user is able to edit this property.
Example:
// Label before anything happens...
TreeNode.Text = "TestNode {ShortCut}";
// when user enters the edit mode, i want to remove the ShortCut entry...
TreeNode.Text = "TestNode";
----

I use the BeforeLabelEdit-Event of the TreeView to change the
text like i want, but when the user is able to edit the node the orginal
text is still there.
When i tried to check the Text via a MessageBox the right value (without the
shortcut) appears in the messageBox, but in the end the original value still
appears.

I can switch to EditMode also with the F2 Button and when i change the
text before i get into the BeforeLabelEdit-Eventhandler everything is ok. It
seems
to me that it is to late to change the text in this event.

Does someone has an idea how to handle this problem?
thx,
patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top