Solved

TWebBrowser Status - Progress

Posted on 2008-10-03
4
392 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:geocoins-software
  • 2
  • 2
4 Comments
 
LVL 21

Expert Comment

by:ziolko
ID: 22637416
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
 

Author Comment

by:geocoins-software
ID: 22637570
set progressbar min := max := 100;

?????

set both to 100 ?
0
 
LVL 21

Accepted Solution

by:
ziolko earned 250 total points
ID: 22637585
>>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
 

Author Comment

by:geocoins-software
ID: 22637653
Works Nice!  THanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question