Very strange issue with tha webbrowser ProgressChanged event

J. Scott Elblein

Well-known member
Joined
Dec 14, 2006
Messages
166
Location
Chicago
Programming Experience
10+
Can someone else see if this same issue happens with them?

I have a web browser object on a form, and in the Progress_Changed event I put some code there (anything really But I have this code):

VB.NET:
        If e.CurrentProgress = 0 AndAlso e.MaximumProgress = 0 Then
            Dim message As String = "Ready"
            Console.WriteLine(message)
            lblReady.Text = message
        End If

Then before that code I put this line of code:

VB.NET:
ToolStripProgressBarCollect.Value = DirectCast(((e.CurrentProgress / e.MaximumProgress) * 100), Double)

What's happening on my computer is, if I browse web pages with that progressbar code there, the Progress changed event simply never fires. I can put a breakpoint right on the first line of the event or on the line of code itself, (or anything after it) and it never breaks, no matter how much I surf around, and the code after it never executes as well.

But if I just comment out that line, the progress changed event fires and all the other code in it executes as usual.

Is it just on mine?
 
VB.NET:
Private Sub ProgressChange(ByVal sender As Object, ByVal e As VbCustomWebBrowser.myBrowserProgress)

If CInt(e.MaximumProgress) > 0 Then
            ToolStripProgressBar1.Value = (CInt(e.CurrentProgress) / CInt(e.MaximumProgress)) * 100
        Else
            ToolStripProgressBar1.Value = 0
        End If
End Sub

This works for me.
 
Hi,

Even i have the same problem with the progress changed event.
When i execute the application this event fires.
When i execute the application again it doesn't fire.
It is quite abnormal, sometimes it fires and sometimes it doesn't.

Can you please gimme a solution if your problem has been resolved?

Regards,
Anil
 
Back
Top