Board index » delphi » Selecting a TreeView.node
nsnwh...@ois.net.au (Nick White)
![]() Delphi Developer |
Wed, 06 Dec 2000 03:00:00 GMT
Selecting a TreeView.nodeI am going to use the following code to select a new node in a Two questions, if I may. (1) Is there a more elegant way (I am using the logic that each new (2) Having found the ItemID of the latest node, how do I then select I would appreciate any help on this. Even if there is a better way For TreeCount := 0 to TreeView1.Items.Count - 1 do Quote> {iterate through the tree until I get the highest number. begin TNNum := integer(TreeView1.Items[TreeCount].ItemID); end; {if TNNum < integer(TreeView1.Selected.Item[TreeCount].ItemID)then} Quote> {Ok. We now have an integer for the highest ItemID in the Tree} Node := TreeView1.Items.GetNode(HTreeItem(TNNum) ); Quote> {this piece of code is straight out of the Dart info on Trees} <") _/ ) ( ) _//- \__/ |