procedure TForm1.ListBox2Click(Sender: TObject);
var
s: string;
i: integer;
f: file of isp;
a: isp;
begin
i:=1;
AssignFile(f, 'isp.txt');
reset(f);
while not eof(f) do
begin
Read(F, a);
md[i]:=a;
i:=i+1;
end;
if listbox2.Itemindex=-1 then
listbox2.Itemindex:=0;
s:=Listbox2.Items.Strings[listbox2.itemindex];
for i:=1 to 10 do
begin
if s=mD[i].name then
begin
Label4.Caption:=md[i].godn;
Label5.Caption:=md[i].kol;
Label6.Caption:=md[i].str;
memo2.Text:=md[i].opisanie;
Image1.Picture.LoadFromFile(md[i].foto);
if listbox2.ItemIndex<>-1 then image1.Visible:=true;
end;
end;
end;