c# - Firing WebBrowser.DocumentCompleted event whilst in a loop -


i have simple app developing needs iterate through list of urls passed webbrowsers navigate function in each loop. hoping see documentcompleted event firing after each call of navigate function seems fired after whole form has completed loading - , loop has completed.

i guess missing fundamental here , advice great!

thanks!

here sample of code trying...

this foreach loop runs n form load event of winforms page using...

            int id = 0;         foreach (datarow row in quals.rows)         {             urn = row["laim_ref"].tostring();              string urn_formated = urn.replace("/", "_");             string url = "http://url_i_am_going_too/";             string fullurl = url + urn_formated;              wbrbrowser.scripterrorssuppressed = true;             wbrbrowser.refresh();             wbrbrowser.navigate(fullurl);              id += 1;              label1.text = id.tostring();          } 

at point loop gets line:

wbrbrowser.navigate(fullurl); 

i hoping event:

        private void wbrbrowser_documentcompleted(object sender, webbrowserdocumentcompletedeventargs e)         { ... } 

would fire therefore being able run processes against each of urls returned in loop.

thanks!

i used:

while (wbrbackground.readystate != webbrowserreadystate.complete) { application.doevents(); } 

after navigate function , works expected.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -