469,903 Members | 2,122 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Change TreeNode.Text before editing

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
4 8605
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
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

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
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.

Similar topics

reply views Thread by Jon Davis | last post: by
1 post views Thread by Anthony Boudouvas | last post: by
reply views Thread by Heinz Müller | last post: by
1 post views Thread by jmDesktop | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.