TWebBrowser Status - Progress

How do Implement a Progress Bar - when displaying a WebPage in a TWebBrowser. I would like to show the progress as the page is loading....just like all webbrowsers do

thanks
geocoins-softwareAsked:
Who is Participating?
 
ziolkoCommented:
>>set both to 100 ?
oops typo, of course min := 0

and use this:

procedure TForm1.WebBrowser1ProgressChange(Sender: TObject; Progress,
  ProgressMax: Integer);
begin
  if ProgressMax <> 0 then
    ProgressBar1.Position := Trunc((Progress / ProgressMax) * ProgressBar1.Max) + 1
  else
    ProgressBar1.Position := 0;
end;

then no matter what max will be:)

ziolko.
0
 
ziolkoCommented:
set progressbar min := max := 100;

and use OnProgressChange() of TWebBrowser like this:

procedure TForm1.WebBrowser1ProgressChange(Sender: TObject; Progress,
  ProgressMax: Integer);
begin
  if ProgressMax <> 0 then
    ProgressBar1.Position := Trunc((Progress / ProgressMax) * 100) + 1
  else
    ProgressBar1.Position := 0;
end;


ziolko.
0
 
geocoins-softwareAuthor Commented:
set progressbar min := max := 100;

?????

set both to 100 ?
0
 
geocoins-softwareAuthor Commented:
Works Nice!  THanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.