"M.H. Avegaart" <avega...@NOSPAMmccomm.nl> wrote:
>You can search the TreeView with:
>const
> MyString = 'RootNode2';
>var
> i: Integer;
>begin
> // for all nodes do
> for i := 0 to TreeView1.Items.Count - 1 do
> // if same caption and root node
> if (TreeView1.Items[i].Caption = MyString) and
> (TreeView1.Items[i].Level = 0) then
> begin
> // do something with node
> Break;
> end;
>end;
>"MeAgain" <sonphu...@zfree.co.nz> wrote in message
>news:3b70d2b2$1@zfree.co.nz...
>> Hello all
>> I create a TreeView and add some nodes of String into it then save it
into
>> file by this code:
>> =========================================
>> TreeNode1 := Add(nil, 'RootNode1');
>> AddChild(TreeNode1,'StringNode1);
>> AddChild(TreeNode1,'StringNode1');
>> TreeNode2 := Add(TreeNode1, 'RootNode2');
>> AddChild(TreeNode2,'String1');
>> AddChild(TreeNode2,'String2');
>> AddChild(TreeNode2,'String3');
>> AddChild(TreeNode2,'String4');
>> AddChild(TreeNode2,'String5');
>> ....
>> TreeView1.SaveToFile('c:\node.dat');
>> ==========================================
>> Then the my file will have structure as:
>> RootNode1
>> StringNode1
>> StringNode2
>> RootNode2
>> String1
>> String2
>> String3
>> String4
>> String5
>> Now I have a string called myString. What I have to do is if myString
is
>> equal with Strings in RootNode1, do action 1. If myString is equal with
>any
>> of String in RootNode2, do action 2.
>> Could you please help me some Guides do that. Do I have open the file
and
>> have to use search function here ???
>> Thank you for your help
>> Nhuyen
>> http://www.zfree.co.nz