### Bookstore

 Computer Math and Games in Pascal (preview) Lazarus Handbook

### Author Topic: Go through Multiple TreeView's  (Read 299 times)

#### Weitentaaal

• Jr. Member
• Posts: 82
##### Go through Multiple TreeView's
« on: October 22, 2020, 09:42:23 am »
Hello Guys,

I wanted to go Through 3 TreeViwe's Items with two For loops. So i Dont know how to do it can any1 help ?

Code: Pascal  [Select][+][-]
1.
2. For i := 1 To 3 do Begin
3.    For nd in Regelung.TreeViewZ.Items[i] do Begin
4.
5.

In The Above Code is ThreeViewZ. Its 1 of the Tree View's. I Would Like to call TreeView1 then TreeView2 ...
is There a way to do it with the value i ?
Like TreeView.Items....

Thanks, Have a great Day

#### howardpc

• Hero Member
• Posts: 3611
##### Re: Go through Multiple TreeView's
« Reply #1 on: October 22, 2020, 10:35:54 am »
Code: Pascal  [Select][+][-]
1. var
2.   arr: array of TTreeView;
3.   tv: TTreeView;
4.   i: Integer;
5. begin
6.   SetLength(arr, 3);
7.   arr[0] := TreeView1;
8.   arr[2] := TreeView2;
9.   arr[3] := TreeView3;
10.
11.   for tv in arr do
12.     for i := 1 to 3 do
13.        begin
14.          tv.Items[i] := ...;
16.        end;
17. end;

#### Weitentaaal

• Jr. Member
• Posts: 82
##### Re: Go through Multiple TreeView's
« Reply #2 on: October 22, 2020, 10:47:28 am »
Thanks Dude !