Thx Bart for the reply.
But where stands Value for?
I tried a recordcounter, but that was even worse.
mvg
Frans van Leeuwen
M 06-51695390
Op 25-1-2018 om 19:36 schreef Bart via Lazarus:
On Thu, Jan 25, 2018 at 7:27 PM, frans via Lazarus
<lazarus@lists.lazarus-ide.org> wrote:
The
progressbar functions fine but when position=max, the progressbar visualy
never reaches the end.
Thank Uncle Bill for that.
The progressbar animates to the position you set it to.
This takes time.
If you do ProgressBar1.Position := ProgressBar1.Max and the
(physically) wait a while, it will get to full 100%.
The trick to get an immediate update is to decrement the position: no
animation, no waiting time.
Unfortunately this cannot be done for the 100% value.
I have some code in one of my apps like this to get rid of the animation:
{$ifdef windows}
if Value > 0 then
begin
//trick modern Windows to draw the position at once, otherwise you
never see the 100%
ProgressBar.Position := Value - 1;
ProgressBar.Repaint;
ProgressBar.Position := Value;
ProgressBar.Repaint;
end;
{$endif}
If it bothers you, there are plenty of customdrawn progressbars out
there (or switch of themes, to get the old behaviour back).
Bart
---
Deze e-mail is gecontroleerd op virussen door AVG.
http://www.avg.com
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus