|
-
Oct 14th, 2000, 11:21 AM
#1
Thread Starter
Fanatic Member
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
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Oct 14th, 2000, 11:28 AM
#2
Guru
Change it just slightly. 
Code:
Do
DoEvents
' Code goes here
Loop Until WebBrowser.ReadyState = READYSTATE_COMPLETE
-
Oct 14th, 2000, 11:31 AM
#3
Thread Starter
Fanatic Member
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?
Visual Basic 6.0
Visual C++ 5
Delphi 5

-
Oct 14th, 2000, 11:38 AM
#4
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
-
Oct 14th, 2000, 11:46 AM
#5
Try this:
Code:
Do Until WebBrowser.ReadyState = READYSTATE_COMPLETE
DoEvents
' Code goes here
Loop
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|