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

How do I set a fix Index for an item at TreeView.

Status
Not open for further replies.

jvff

Programmer
Apr 1, 2001
64
BR
Hi I created this TreeView

Project
C++ Files
Resources
Classes

then when I click a button ity adds a child to Item[1]

Project
C++ Files
Noname
Resources
Classes

then when I click a button to add a resource Item[2] it does this:

Project
C++ Files
Noname
ResourceFile
Resource
Classes

How can I fix this? ThanQ, ;-)

JVFF (Janito Vaqueiro Ferreira Filho)
 
you have to get the handle for item "Resource" and add child to it. that can be done through property TTreeView->Selected.
if you want to set some fix index to TTreeNode, you can do it through void* Data, but you have to overcast it to int. then you go through all nodes in treeview and compare for Node->Data and if it equals - voila, you've got the node you were looking for and you can add it a child.
I hope it helped you.

mironto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top