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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Know the newly added node in treeview 1

Status
Not open for further replies.

swetham

Programmer
May 5, 2010
257
DE
I have created a treeview in which i gave the option to add,edit,delete. Now when add is clicked, new node is getting added below the respective parent node. How to add a tag to that added node.

For adding node i have used the below code,


NodeClicked is a variable of treenode type.

NodeClicked.Nodes.add("Enter New Node")
 

Instead of adding a node with the node's text in the .Add method, build a new treenode and add that:

Dim tn As New TreeNode

tn.Text = "New Node"
tn.Tag = "Something in the tag"

NodeClicked.Nodes.Add(tn)


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top