webBrowser_ProgressChanged event not firing?

J. Scott Elblein

Well-known member
Joined
Dec 14, 2006
Messages
166
Location
Chicago
Programming Experience
10+
Hi all

I am learning my way around the web browser control, and I both love it and I hate it. LOL

I am desperately trying to get a *reliable way* of detecting when a web page is truly, fully and completely done downloading (iFrames, and the whole nine yards).

It's been a nightmare so far. I can't believe MS would not be able to recognize this when they released the control. But anyway.

I am trying to do some things in the aforementioned event, but it simply is not firing any time I go to a web page. Am I missing something?

Also, does anyone have a sound way of detecting when a page is fully loaded? I would soooooooooooooooooooooooooooooooooooo appreciate it!

TIA
 
this is the standard progress handler:
VB.NET:
Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, _
ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) _
Handles WebBrowser1.ProgressChanged
    ProgressBar1.Maximum = e.MaximumProgress
    ProgressBar1.Value = e.CurrentProgress
End Sub
this is the values I detected with a frameset page (m=max,v=value):
m10000v100m10000v100m10000v100m10000v100m10000v100m10000v10000m10000v10000m0v0
maybe you can use the max=0 for something?

for the same frames test I detected the ReadyState for each DocumentCompleted event call and got this:
Interactive
Interactive
Interactive
Complete
this is the combined order of the progress and completed events:
m10000v100m10000v100m10000v100m10000v100m10000v100m10000v10000Interactive
Interactive
Interactive
m10000v10000Complete
m0v0
Here is another sample for a site that has a particular long loading sequence, it isn't even using frames!?:
m10000v100m10000v150m10000v150m1000000v22600m1000000v35300m1000000v47200m1000000v57700m1000000v76900m1000000v89200m1000000v102600m1000000v117200m1000000v133000m1000000v150200m1000000v168900m1000000v189200m1000000v211300m1000000v234000m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v100m10000v150m10000v150m10000v150m10000v150m10000v150m10000v150m1000000v113900m1000000v1000000Interactive
m1000000v734400m1000000v702400Interactive
m1000000v990400m1000000v174800m1000000v814400Interactive
Interactive
Interactive
m1000000v718600m1000000v284200Interactive
m1000000v990800Interactive
Interactive
m1000000v933200Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
Interactive
m0v0Interactive
Interactive
Interactive
Interactive
m0v0Complete
(oh, it was using lots of Iframes)
 
Hi John.

Very useful info there. I am playing with the readystate in the doccompleted event now thanks to that. One thing I still don't understand though, what could prevent the Progresschanged event from firing? Doesn't it trigger every single time a new page is navigated to? I place a breakpoint at the very first instruction in the event and it just never breaks?
 
I have no idea, post a sample project that reproduces the problem.
 
Back
Top