WebProgressBar position issue

Hi,

The progres doesn't change position when we assign new value lower then 100.
Is this designed ?
If we change value when in between min and max it works.

procedure TForm25.WebTimer1Timer(Sender: TObject);
begin
WebProgressBar1.Position := WebProgressBar1.Position + 5;
if WebProgressBar1.Position>100 then
WebProgressBar1.Position := 0; // When is Position is over 100 it doesn't reset to 0
WebLabel1.Caption := Format('%d / %d',[WebProgressBar1.Position,WebProgressBar1.Max]);
end;

regards, Vojko

This is because WebProgressBar1.Position is limited to its Max setting.
So, even when you assign 105 to WebProgressBar1.Position and Max = 100, the position setting will be clamped to 100.
So, you would need to write your code as:

var
  p: integer;
begin

  p := WebProgressBar1.Position + 5;
  if p > 100 then
    p := 0;

  WebProgressBar1.Position := p; // When is Position is over 100 it doesn't reset to 0

  WebLabel1.Caption := Format('%d / %d',[WebProgressBar1.Position,WebProgressBar1.Max]);
end;

thank you,

  1. Position is not clamped to 100, but is 105 in
    WebLabel1.Caption := Format('%d / %d',[WebProgressBar1.Position,WebProgressBar1.Max]);

That's why I found it strange, otherwise I would know that the value doesn't get over 100.

  1. Also when WebProgressbar1 Position is in 105, we cannot reset it to 0 even in other separate button event. As it stays "glued" to this value (here 105).

regards,
Vojko

You're correct. We have seen an issue with the property setter and fixed it.