Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic naming of a treeview Node

Status
Not open for further replies.

SteveMac32

Programmer
Jan 25, 2002
74
GB
I need a hand here. I create a node when the user picks the ‘Create New Child Node’ option from a menu.... this is not a problem the problem is the naming of this node, as this will be user definable.

After the Node has been created it needs to be selected with the blinking cursor in the name box ready for the user to enter a name (much like the new folder option in windows)

When I create the new node using the code below:

Set ChildNode = tvwOSD.Nodes.Add(lngParentIndex, tvwChild, , " New Child Node", intImage)
ChildNode.Selected = True

Any help will be appreciated

Thanks

Steve
 
Steve,

Use this code to initiate the edit

[tt]
Set ChildNode = tvwOSD.Nodes.Add(lngParentIndex, tvwChild, , " New Child Node", intImage)
ChildNode.Selected = True
tvwOSD.StartLabelEdit
[/tt]

Hope this helps,



jgjge3.gif
[tt]"Very funny, Scotty... Now Beam down my clothes."[/tt]
 
Doh!!!

Must have been a hard morning I found the property:

tvwOSD.StartLabelEdit

And then used the 'tvwOSD_AfterLabelEdit' Procedure

Don’t know how I missed it…………..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top