How to make browsercontrol surf while executing more code?

  • Thread starter Thread starter Geek
  • Start date Start date
G

Geek

I have a userform in VB.bnet which contains a webbrowser control.
I want to let the webbrowser navigate to a certain URL and when the
navigation has finished I want to run further actions against the page.
Whatever I try, the browser won't load a page as long as there's any code
running. Only after the code has been finished the navigation will take
place.

How can i get my browser to navigate as requested and have my code wait for
the browser to complete?
 
I have a userform in VB.bnet which contains a webbrowser control.
I want to let the webbrowser navigate to a certain URL and when the
navigation has finished I want to run further actions against the page.
Whatever I try, the browser won't load a page as long as there's any code
running. Only after the code has been finished the navigation will take
place.

How can i get my browser to navigate as requested and have my code wait for
the browser to complete?

IIUC, Just navigate webpage using Webbrowser.Navigate method, then
handle DocumentCompleted event to execute "further actions" you
desire. Note that, sometimes DocumentCompleted event can fire more
than once especially if the page uses iframes.

http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.documentcompleted.aspx

HTH,

Onur Güzel
 
Back
Top