The call to
e.WaitOne()
blocks the current thread until the
AutoResetEvent
is set. The
WebBrowser
control will raise its events in response to window messages processed on the current thread. I'm sure you can see the slight problem there! :)
The quick-and-dirty solution would be to use
Application.DoEvents
:
browser.Navigate(url.ToString());
while (!e.WaitOne(0))
{
Application.DoEvents();
}