Einzelnen Beitrag anzeigen

WizoHulk

Registriert seit: 25. Jun 2010
198 Beiträge
 
Delphi 5 Enterprise
 
#1

Listview 3 Spalte Progressbar

  Alt 22. Mai 2011, 20:23
Hallo an alle

ich habe ein Listview mit 3 Spalten. Nun möchte ich ich in der 3. Spalte eine Progessbar createn.
Mit diesen code funktioniert das erstellen ja schon mal ganz gut, aber wie bekomme ich die PB in die dritte Spalte?
Delphi-Quellcode:
procedure TFmTabelle.SetzteProgressBarAufLV(aListView: TListView; aListItem: TListItem);
const
  ProgBarColumnIndex = 1;
  ProgBarMax = 100;
var
  ProgBar : TProgressBar;
  pbRect : TRect;
begin
  ProgBar := TProgressBar.Create(nil);
  ProgBar.Style := pbstMarquee;
  ProgBar.Parent := aListView;
  aListItem.data := ProgBar;
  pbRect := aListItem.DisplayRect(drBounds);
  pbRect.Left := pbRect.Left + aListView.Columns[-1 + ProgBarColumnIndex].Width;
  pbRect.Right := pbRect.Left + aListView.Columns[ProgBarColumnIndex].Width;
  ProgBar.BoundsRect := pbRect;
end;
Listview füllen der Spalten

Delphi-Quellcode:
      Screen.Cursor := crHourGlass;
      {* Value in Listeditor *}
      li := ListView.Items.Add;
      li.Caption := sName; //erste Spalte Name
      li.SubItems.Add(sPfad); //zweite Spalte Pfad
      li.SubItems.Add(sDateigroesse); //dritte Spalte Größe
      SetzteProgressBarAufLV(ListView,li);

Geändert von WizoHulk (22. Mai 2011 um 20:50 Uhr)
  Mit Zitat antworten Zitat