   [.net] TreeView help (C++ Forms)
  sorry about the vague topic title!The situation I have is with a game editor tool I'm writing.Objects in the scene are put into the TreeView using their Name (ie. Box01).  But, the engine I'm using can only select an object with the unique ID name (a user-unfriendly mess of numbers and chars), or GUID.So, what I've tried to do is create a second TreeView that isn't actually displayed in the form that stores the GUID.  This seems fine except I can't find any support with TreeView to retrieve a Node based on Index.  I'm able to RomoveAtIndex or get the Index of a pre-known Node, but not select by Index!Any suggestions?  Is there a way to attach custom data to each Node? So that it's Text can be the object name, but also have it's GUID stored?It seems like a grossly inefficient way to go about it...  I'm new to C++ and am used to managed C# and Java! :)Thanks!   
  You should be able to store extra data with each item in the TreeView. I know with the ListViewItem you can do something like this:ListViewItem^ item = gcnew ListViewItem("Box01");item->Tag = "9B9B0000-6F5C-4167-8841-9EBD2C7CB179";listView->Items->Add(item);You can then retrieve the GUID from the Tag property later.Looking in the Object Browser, it seems TreeNode has the same property.   ;Quote:Original post by MrEvilYou should be able to store extra data with each item in the TreeView. I know with the ListViewItem you can do something like this:*** Source Snippet Removed ***You can then retrieve the GUID from the Tag property later.Looking in the Object Browser, it seems TreeNode has the same property.TreeNode has three items that can be used.  First is TreeNode.Text, that is the text that will show in the TreeView to the user.  So in your case Box01.  What you are looking for is TreeNode->Name.  TreeNode->Name is also the TreeNodeCollection's key.  This is where you would put your GUID.  So you can get the node you are looking for using the name by doing this;TreeNode * node = treeView1->Nodes[node_string];What the Tag is normally used for is to attach another object to the TreeNode.  Say you have a Mesh associated with the screen object.  You can assign the Mesh object to the Tag property and then you will have the mesh as part of the TreeNode and can get it at will.  That should be what you are looking for.theTroll[Edited by - TheTroll on September 9, 2007 9:53:46 AM];  Thanks guys, learnt something new and solved a problem! Cheers!Matt   