In an application I want to find all nodes that contain eg. the words "plot.plott".
I do not find a method that repeatedly give me the next node that fit the word, only the first node as in the TreeRoots.pas example.
Is the needed action not available or do I miss something obvious ??
Repeatedly find items that contain the same string
-
- Newbie
- Posts: 21
- Joined: Mon Jan 23, 2006 12:00 am
Re: Repeatedly find items that contain the same string
There is no method to retrieve nodes as such, however, you can implement this on a relatively easy way. The Shapes property contains all the nodes in the tree, so you can iterate these and perform your match on every node, as in:
Regards,
Tom.
Code: Select all
procedure TForm2.FindNodesClick(Sender: TObject);
var t: integer;
begin
for t:=0 to Tree1.Shapes.Count-1 do
if (Pos('TreeNode',Tree1.Shapes[t].SimpleText)>0)then
begin
Showmessage(Tree1.Shapes[t].Name);
end;
end;
Tom.