Announcement

Collapse
No announcement yet.

Bitmaps in Listview

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bitmaps in Listview

    Gibt es eine möglichkeit ohne eine Imagelist, Bitmaps in beliebigen Items einer Listview darzustellen ?

    Gruss

    Stefan

  • #2
    nochmal zur Erklärung.
    Ich habe bisher folgenden Quelltext:

    for I:= 0 to Zquery1.recordCount-1 do
    begin
    try
    listview1.Items.Add;
    listview1.Items[i].SubItems.Add:= Zquery1.fieldbyname('NAME').AsString;
    listview1.Items[i].Caption:= Zquery1.fieldbyname('Country_id').AsString;
    //Bildeinfügen
    r := Listview1.Items[i].DisplayRect(drBounds);
    r.Left := r.Left + Listview1.columns[0].Width;
    r.Right := r.Left + Listview1.columns[2].Width;
    Bitmap := timage.Create(self);
    try
    if Fileexists(main.Form1.Dir+'\flags\'+Zquery1.fieldb yname('Country_ID').AsString+'.bmp') then
    bitmap.Picture.LoadFromFile(main.Form1.Dir+'\flags \'+Zquery1.fieldbyname('Country_ID').AsString+'.bm p') else
    bitmap.Picture.LoadFromFile(main.Form1.Dir+'\flags \0.bmp');
    bitmap.Parent:=Listview1;
    bitmap.BoundsRect:=r;
    listview1.Items[i].Data:=bitmap;
    finally
    end;
    except
    end;
    Zquery1.Next;
    end;

    Das funktioniert eigentlich auch, also die Bilder werden angezeigt, nur bekomme ich das mit SubITems nicht hin sondern wirklich nur in Items.
    Keiner ne Idee ???

    Gruss

    Stefa

    Comment

    Working...
    X