By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,152 Members | 2,159 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,152 IT Pros & Developers. It's quick & easy.

Change TreeNode.Text before editing

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
What you will have to do is subclass the edit box in the
BeforeLabelEdit event. You can find an article concerning this here:
<a
href="http://www.devx.com/vb2themax/Tip/18447">http://www.devx.com/vb2themax/Tip/18447</a>

Nov 16 '05 #2

P: n/a
What you will have to do is subclass the edit box in the
BeforeLabelEdit event. You can find an article concerning this here:
<a
href="http://www.devx.com/vb2themax/Tip/18447">http://www.devx.com/vb2themax/Tip/18447</a>

Nov 16 '05 #3

P: n/a

Johnny Thawte wrote:
What you will have to do is subclass the edit box in the
BeforeLabelEdit event. You can find an article concerning this here:

Let's try this link again:

http://www.devx.com/vb2themax/Tip/18447

Nov 16 '05 #4

P: n/a
Hi Johnny,

this is exactly what i need, thanks for reply ;)

patrick
"Johnny Thawte" wrote:

Johnny Thawte wrote:
What you will have to do is subclass the edit box in the
BeforeLabelEdit event. You can find an article concerning this here:

Let's try this link again:

http://www.devx.com/vb2themax/Tip/18447

Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.