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

TreeView operations

Status
Not open for further replies.

mironto

Programmer
May 12, 2001
26
SK
I'm using TTreeView with defined several Nodes. I also have several images on form. I want to program action that after I click on some image, in TreeView gets selected for example first Node. I tried
TreeView1->Selected=TreeView1->Items[0];
but it didn't work because Selected is TTreeNode* and Items[0] is TTreeNodes.
please help someone
 
dear mironto,

try to get the node You need with a methid or a property described in the helpindex under TTreeNode.

For example, if you need the first Node (Items[0] in case of TTreeNodes), write:

Code:
TTreeNode  *whatevernamed_RootNode = TreeView1->Items->GetFirstNode();

be careful with getFirstChild(), here the small "g" is needed. all others are written in Capitals
(GetFirstSibbling() etc.)

happy new year!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top