|
-
Oct 6th, 2010, 09:04 AM
#33
Fanatic Member
Re: using .getElementsByName
Well if thats in the main thread, you will hang your entire app permanently, as you can't sleep the thread and load the webpage asynchronously from the same thread. You'd need to create a new thread for that wait sub.
vb Code:
Dim nT As New Threading.Thread(AddressOf wait) nT.Start() Private Sub wait() While WebBrowser1.ReadyState < 4 Threading.Thread.Sleep(100) End While '//next call after WebBrowser is finished loading End Sub
As for only doing it once, you need to narrow down when the procedure is run on the documentcompleted event. At the moment, whenever the document finishes loading it will run. Either slip in a global boolean that you set by default to true, on the documentcompleted event check if this is true or not, and if so run it and then set the value to false to prevent further execution.
Last edited by J-Deezy; Oct 6th, 2010 at 09:07 AM.
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
|