Solved

TWebBrowser Status - Progress

Posted on 2008-10-03
4
369 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
Comment Utility
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
Comment Utility
set progressbar min := max := 100;

?????

set both to 100 ?
0
 
LVL 21

Accepted Solution

by:
ziolko earned 250 total points
Comment Utility
>>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
Comment Utility
Works Nice!  THanks
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now