Sincronize 4 ListBox  

Send By: Radikal (Q3 Team)
Web : http://www.q3.nu
Email: radikal@q3.nu
Date: 26/10/99

Tip accessed 487 times

 


Supposing that they are named ListBox1, ListBox2.. 3 and 4 , simply put this code in the OnClick of all them (you can only put it in the first one and to the rest of ListBox you assign him the OnClick of the first one)


 procedure TForm1.ListBox1Click(Sender: TObject);
 var
    n:byte;
 begin
   for n:=2 to 4 do
   begin
     (FindComponent('ListBox'+IntToStr(n))as TListBox).ItemIndex:=
     (Sender as TListBox).ItemIndex;
   end;
 end;