|
-
Feb 15th, 2009, 12:13 PM
#1
Thread Starter
Addicted Member
[VB2008] Wait for all objects in axwebbrowser to load?
How would I wait for all objects (images, etc) to load in my webbrowser control, without locking up the form in a loop? Anyone?
-
Feb 15th, 2009, 12:28 PM
#2
Re: [VB2008] Wait for all objects in axwebbrowser to load?
The webbrowser has a DocumentCompleted event. That event will fire when the document has finished loading.
-
Feb 15th, 2009, 12:29 PM
#3
Thread Starter
Addicted Member
Re: [VB2008] Wait for all objects in axwebbrowser to load?
Well, i knew that lol, but it doesn't wait until the images have loaded, only the page itself.
-
Feb 15th, 2009, 12:38 PM
#4
Re: [VB2008] Wait for all objects in axwebbrowser to load?
This code works for me, it doesn't show the message box until all of the images are loaded:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("http://gettyimages.com/Editorial/News.aspx")
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
MessageBox.Show("Done!")
End Sub
Now if there is some javascript that is pulling down the images, I could understand why that wouldn't be done downloading when the images are still loading.
Think of something like google maps, that pulls down the images as you drag and move the map, but the page has been long since loaded. If you are trying to trap something like that, I think it is going to be more difficult.
-
Feb 15th, 2009, 12:41 PM
#5
Thread Starter
Addicted Member
Re: [VB2008] Wait for all objects in axwebbrowser to load?
that doesn't work for me, I'm trying to communicate with a vBulletin forum, but because all the objects don't seem to be loaded it keeps giving me this error:
Your submission could not be processed because a security token was missing or mismatched.
And it's on almost every board I try. The only explanation that I see is plausible is that the hidden form for the security token hasn't loaded yet.
-
Feb 15th, 2009, 12:45 PM
#6
Re: [VB2008] Wait for all objects in axwebbrowser to load?
If you put in a 10 second wait after you start loading, does it work? If it does, then you can work on figuring out how to avoid using that 10 second delay.
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
|