Web Browser

Cheetah

Well-known member
Joined
Oct 12, 2006
Messages
232
Programming Experience
Beginner
Hi there,

I am new to these forums and new to VB.NET.

I am having a little trouble.

Basically what i want is for the web browser to finish loading the web page before the program continues with the next commands, if that makes sense.

How would i go about doing this?

Thanks.
 
Checking if wb.ReadyState = WebBrowserReadyState.Complete in DocumentComplete event is usually sufficient.
 
I tried putting that in a Do While Loop, but it doesn't seem to work.

The loop just keeps continuing.

Basically i need the program to keep running.

So i want the program to stop and wait for the web page to load, and then continue.
 
Last edited:
Have you tried the DocumentComplete Event Handler?

Have you tried the DocumentComplete Event Handler? It's built into the webbrowser control and shouldn't fire until the Document has completely loaded and intialized.
 
yah... only it is very common that a webpage consist of many "documents" and each one will fire a DocumentComplete event during navigating, thus the above suggestion.
 
That makes since. I was using this event and it was firing many times but I thought it was a programming error from my side so I built a work around. So other than the WebBrowserReadyState property there is no other way to determine if it's completely finished or not huh....

I will work up a new class that uses a background thread which specifaclly checks this state and fires a seperate event for each property change. Then you can just check the event of BrowserReady or what have you and run your code there. If you can do this yourself that would probably be a big help in the long run, if not I will try to update the BrowserControl to accomidate it for us. not sure if you can inherit the browsercontrol b/c I am at work but if not I will build a new Class that contains it as an object and works this for you. :) I am confident we can make this work better. What you think JohnH, does that sound like a good project?
 
Back
Top