Sign in Join

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

Mailing lists / lazarus / 2010-09

PaintTo doesn't work with TProgressBar

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Stefan Schalk

Hello!

I want to paint a progress bar to a canvas of a TStringGrid.

  ProgressBar := TProgressBar.Create(MyStringGrid);
  if Assigned(ProgressBar) then
  begin
    ProgressBar.Parent := MyStringGrid;
    ProgressBar.Visible := false;
    ProgressBar.Left := GridCellRect.Left;
    ProgressBar.Top := GridCellRect.Top;
    ProgressBar.Width := GridCellRect.Right - GridCellRect.Left;
    ProgressBar.Height := GridCellRect.Bottom - GridCellRect.Top;
    ProgressBar.Min := 0;
    ProgressBar.Max := 100;
    ProgressBar.Position := TheProgressValue;
    ProgressBar.Orientation := pbHorizontal;
    ProgressBar.PaintTo(MyStringGrid.Canvas, GridCellRect.Left,
GridCellRect.Top);
    FreeAndNil(ProgressBar);
  end;

With Delphi this works, but with Lazarus no progress bar appears. Can someone tell me how to paint the progress bar successfully?

Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100916/c1b9dc3e/attachment.html>

Reply by email