|
OnProgressChange fires when the progress of a download operation is updated.
The event handler is used to provide visual feedback about the
download process. For example, an OnProgressChange event handler can update a
TProgressBar component or display the number of bytes downloaded so far.
Command Arguments:
Sender
- The TEmbeddedWB component for which the event is being generated. Usage:
(Sender as TEmbeddedWB)
Progress
- Total progress made so far (number of bytes). -1 if complete.
ProgressMax
- Maximum progress value (number of bytes.)
procedure TbrowserFrm.WB1ProgressChange(ASender: TObject; Progress,
ProgressMax: Integer);
begin
If (Progress>=1) and (ProgressMax>1)
then
begin
ProgressBar1.Visible := True;
ProgressBar1.Position := Round((Progress * 100) Div ProgressMax);
StatusBar1.Panels[1].Caption := Format('%d %', [Progress Div 100]);
end
else
begin
ProgressBar1.Position := 1;
StatusBar1.Panels[4].Caption:='';
ProgressBar1.Visible := False;
end;
end;
|