How to make browsercontrol surf while executing more code?

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?
 
O

Onur Güzel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top