i want to call webBrowser.Navigate(string urlString) synchronously where webBrowser is windows forms control. I do this in such way
...
private delegate void
Rather use this to retrieve the page syncronously:
this.webBrowser.DocumentCompleted += WebBrowserDocumentCompleted;
this.webBrowser.Navigate("http://google.com");
private void WebBrowserDocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
MessageBox.Show("Operation has completed !");
}
Not the best way, but you can use this...
while (this.webBrowser.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
Thread.Sleep(100);
}