Sign in to follow this  
Khaos Dragon

web browser problems

Recommended Posts

I am having trouble getting my app to wait until the webbrowser has finished its operations before outputting its data. I quite simple loop until the webBrowser is not busy and for some reason it does not seem to be working.
//before this point webBrowser contains an older page we shall call A
object o = null;
webBrowser.Navigate( "", ref o, ref o, ref o, ref o);
while( webBrowser.Busy )

//ideally at this point the webBrowser should contain the page returned from, we shall call it B

mshtml.HTMLDocumentClass doc = new mshtml.HTMLDocumentClass();
doc =   (mshtml.HTMLDocumentClass) webBrowser.Document;
textBox1.Text = doc.documentElement.innerHTML;
//the text that shows up in the textbox is from A, not B
//If I make a button which outputs the current webbrowser document to the textbox 
//and wait a few seconds and manually trigger it, then I get B in my textbox. From 
//my perspective it seems like the while( webBrowser.Busy ) loop is hardly being used

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this