R. Jackson
R. Jackson

Reputation: 21

Delphi's TreeView - How do I select/highlight node by AbsoluteIndex

How would I select/highlight a TreeView node in Delphi if I have its TTreeNode.AbsoluteIndex?

Upvotes: 2

Views: 3688

Answers (1)

David Heffernan
David Heffernan

Reputation: 613612

The AbsoluteIndex of a node identifies it in the tree's Items collection. So if you know the AbsoluteIndex you can recover the node like this:

Node := Tree.Items[AbsoluteIndex];

You can then select this node using the tree's Select(TTreeNode,TShiftState) method:

Tree.Select(Node);

Upvotes: 2

Related Questions