-
Check out this code. It freezes the program if the browser isn't ready!
Code:
Do
If WebBrowser.ReadyState = READYSTATE_COMPLETE Then
'Code goes here
End If
Loop Until WebBrowser.ReadyState = READYSTATE_COMPLETE
Try it on your Pc and tell me what happens
-
Change it just slightly. :rolleyes:
Code:
Do
DoEvents
' Code goes here
Loop Until WebBrowser.ReadyState = READYSTATE_COMPLETE
-
i think there's an error in my code. Because I want my form to do something when the browser is ready and I want it to do that thing only once. so How would I do that?
-
Add this to a timer loop:
Code:
Private Sub Timer1_Timer()
If Browser.ReadyState = READYSTATE_COMPLETE Then
Timer1.Enabled = False
'Code Here
End If
End Sub
-
Try this:
Code:
Do Until WebBrowser.ReadyState = READYSTATE_COMPLETE
DoEvents
' Code goes here
Loop