Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-04

How to draw a progress bar under a column of a listview?

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

YanChengyuan
hi,all!i'm looking for a way to make a listview looks like this:
i set a list view to vsReport and wrote the following code:
Procedure Tform1.Button1click(Sender: Tobject);
var
  l:TListItem;
  r:TRect;
Begin
  l:=lv.Items.Add;
  l.Caption:='item '+IntToStr(lv.Items.Count);
  r:=l.DisplayRect(drBounds);
  r.Left:=r.Left+lv.Column[0].Width;
  r.Right:=r.Left+lv.Column[1].Width;
  lv.Canvas.Pen.Color:=clRed;
  lv.Canvas.Brush.Color:=clRed;
  lv.Canvas.Rectangle(r);
  lv.Canvas.FillRect(r);
End;
but this method doesn't work at all! there is no red rectangle under the
column.
can anyone help me?

regards,
Yan Chengyuan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090407/b90e9ed3/attachment.html -------------- next part --------------
A non-text attachment was scrubbed...
Name: pic1.jpg
Type: image/jpeg
Size: 6205 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090407/b90e9ed3/attachment.jpg

Reply by email