I want to call webBrowser.Navigate (string urlString) synchronously, where webBrowser is window shape control. I do it this way
... private delegate void NavigateDelegate(string s); ... private void Function() { NavigateDelegate navigateDelegate = new NavigateDelegate(this.webBrowser1.Navigate); IAsyncResult asyncResult = navigateDelegate.BeginInvoke("http://google.com", null, null); while (!asyncResult.IsCompleted) { Thread.Sleep(10); } MessageBox.Show("Operation has completed !"); }
but the message is never locked. Why is this code not working correctly?
source share