Loading Bar - Web Browser [RESOLVED]
Hi Again Everyone
I have made a standard webbrowser and at the bottom of the form i am wanting to put a progress bar so the user knows how long the page is going to take to load but as some pages are going to take longer than others so a standard timer wont do it
Any help on the matter would be appreciated
1 Attachment(s)
Re: Loading Bar - Web Browser
This has a progress control in it.
Re: Loading Bar - Web Browser
Quote:
Originally Posted by dglienna
This has a progress control in it.
Thank you for trying to send this but i am using an internet connection which is a shared internet connection and the administrator has set the security settings to deny all incoming files
If you could possible take the file and print the code which would be required for the progress bar.
Thanks
Re: Loading Bar - Web Browser
Use the ProgressChange event.
Re: Loading Bar - Web Browser
Add the progress bar:
in the Webbrowser event Progress
VB Code:
Private Sub Command1_Click()
WebBrowser1.Navigate "http://www.vbforums.com"
End Sub
Private Sub WebBrowser1_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
On Error Resume Next
ProgressBar1.Max = ProgressMax
ProgressBar1.Value = Progress
End Sub
Re: Loading Bar - Web Browser
Quote:
Originally Posted by penagate
Use the ProgressChange event.
Thank you penagate for telling me the property i have to change
and thank you [LGS]Static for your help with the code
The program now works the way i want it too
Re: Loading Bar - Web Browser
Please notice that the ProgressChange event works very unreliable. That code snippet was the only way I could more or less get it to work. The MSDN documentation doesn't list any bugs or problematic behavior, but the parameters sometimes have very strange values. Sometimes the ProgressMax parameter is even higher than the Progress parameter... :confused: That's why the error handler is added to the code.
Re: Loading Bar - Web Browser
Quote:
Originally Posted by TheVader
Please notice that the ProgressChange event works very unreliable. That code snippet was the only way I could more or less get it to work. The
MSDN documentation doesn't list any bugs or problematic behavior, but the parameters sometimes have very strange values. Sometimes the ProgressMax parameter is even higher than the Progress parameter... :confused: That's why the error handler is added to the code.
I think you mean Progress is higher than ProgressMax :D
Who knows why.
Re: Loading Bar - Web Browser
Quote:
Originally Posted by penagate
I think you mean Progress is higher than ProgressMax :D
:lol: The other way around wouldn't be so noteworthy...
By the way, here are the results of ProgressChange when navigating to vbforums.com. The first values look fairly accurate, but in the end it becomes strange... :confused:
Code:
Progress Max
0 10000
50 10000
10500 1000000
21200 1000000
31800 1000000
43000 1000000
61100 1000000
71900 1000000
84700 1000000
105900 1000000
121400 1000000
158800 1000000
171300 1000000
247700 1000000
279400 1000000
290800 1000000
304500 1000000
321300 1000000
342500 1000000
355300 1000000
370200 1000000
387900 1000000
409700 1000000
452100 1000000
510500 1000000
607900 1000000
607900 10000
10000 10000
-1 10000
0 0
1000000 1000000
1000000 1000000
-1 1000000
1000000 1000000
0 0
Re: Loading Bar - Web Browser
yeah, here's what I got, pretty much the same:
Code:
Prog ProgMax
100 10000
100 10000
150 10000
200 10000
250 10000
300 10000
350 10000
41800 1000000
52200 1000000
64300 1000000
75000 1000000
85000 1000000
97600 1000000
112600 1000000
124000 1000000
137000 1000000
151300 1000000
166900 1000000
185300 1000000
205300 1000000
216400 1000000
228300 1000000
241100 1000000
254800 1000000
269600 1000000
285600 1000000
303800 1000000
322100 1000000
344100 1000000
366600 1000000
392800 1000000
422700 1000000
457600 1000000
467900 1000000
704000 1000000
704000 10000
704050 10000
766800 10000
807900 10000
1340400 10000
1704000 10000
1704000 10000
1704050 10000
1704100 10000
10000 10000
-1 10000
0 0
Except mine goes retarded a bit earlier. It is really strange.
Re: Loading Bar - Web Browser
Thank you verytone for taking an interst to my post
And thank you for your help
Thanks