procedure TMainForm.FormShow(Sender: TObject);
var
I: Integer;
ProBar: TGauge;
Li: TListItem;
begin
for I := 0 to DataListView.Items.Count - 1 do begin
Li := DataListView.Items[I];
ProBar := TGauge.Create(Self);
ProBar.Parent := DataListView;
Li.Data := ProBar;
ProBar.Left := Li.DisplayRect(drBounds).Left + DataListView.Columns[0].Width+5;
ProBar.Top := Li.DisplayRect(drBounds).Top+1;
ProBar.Width := DataListView.Columns[1].Width-5;
ProBar.Height:= 14;
ProBar.BackColor:=$00F6F6F6;
ProBar.ForeColor:=clSilver;
ProBar.Font.Name:='Tahoma';
ProBar.Font.Size:=8;
end;
end;
procedure TMainForm.FormDestroy(Sender: TObject);
var
I: Integer;
begin
for I := 0 to DataListView.Items.Count - 1 do begin
if DataListView.Items[I].Data <> nil then
TProgressBar(DataListView.Items[I].Data).Free;
end;
end;
procedure TMainForm.Timer1Timer(Sender: TObject);
begin
Randomize;
TGauge(DataListView.Items[Random(DataListView.Items.Count)].Data).Progress := Random(101);
end;