Treeview question for Lischke

Hi all,

How can I traverse a tree. I am using Lischke's TreeNT and would like to be able to traverse the tree, check a node's associated data and then decide whether or not to manipulate the node (ie. bold it or color it). Maybe even put a checkbox radiobutton next to it. Although the colors will suffice.

I would appreciate some help. Thanx.
Fats
ffelaarAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
LischkeConnect With a Mentor Commented:
Hi ffelaar,

iterating through it tree is quite easy when using the usual navigation functions like GetNext, GetNextVisible, GetNextSibling, GetNextChild or GetNextSelected (similar for previous nodes). So what you essentially need is a start point and the proper navigation function in a loop:

var
  Node: TTreeNTNode;
  Data: PMyData;

begin
  Node := TreeNT1.GetFirstNode;
  while Assigned(Node) do
  begin
    Data := Node.Data;
    // act here depending on data
    ...
    // get next node in order (could also be the sibling etc.)
    Node := Node.GetNext;
  end;
end;

Ciao, Mike
0
 
LischkeCommented:
Did you read my comment?
0
 
ffelaarAuthor Commented:
Comment accepted as answer
0
 
ffelaarAuthor Commented:
Thank you.
0
All Courses

From novice to tech pro — start learning today.