0
Reply

Navigating in functions - returns back before navigating is done.

Mads

Mads

Feb 27 2009 3:35 AM
1.8k
Hey.
I have this little problem that I have a function called goToSites(). In that function there is a lot of other functions called.
All these functions in goToSites() are functions who navigates to another website in my browser.
An example of one of these functions could be:

webBrowser1.Navigate("http://onesite.com");

                webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(
          delegate
          { "My code" } );

But, it just starts the navigating of the webbrowser, and it goes straight back to where it was called (goToSites()).
And then it starts a new navigating before the other sites even was loaded. So it ends up it is only the site in the last function that are getting navigated and shown in the webbrowser.

Now my big question is, how can I solve this problem?
I have wondered about if it is possible to make a function, that doesn't return at all before the return command is called? Then it could be a possibility for solving the problem.

Hope you guys can help :)