解决方案
WebBrowser控件被认为是"使用中"如果有一个正在处理的导航操作,或控制任何阻塞对话是当前打开的(包括上下文菜单,Javascript警告,NTLM登录对话框,等等)。您可以使用 WebBrowser.IsBusy 属性来检测这些状态。
如果由于当前不完整的导航操作,你可以尝试停止当前的导航(如果你确实想停止网页时未完成加载),或者添加新的导航到一个请求队列,并使用定时器等待直到 WebBrowser.IsBusy 返回false。
如果不是占线状态是由于一个或多个打开的对话框阻止,你可以做同样的等待技术也许 Messagebox.Show()用户一条消息,未决的导航由于延迟一个开放的对话窗口。
原文
The WebBrowser control is considered "in use" if either a navigation action is currently being processed, or any blocking dialog from the control is currently open (including context menu, Javascript alerts, NTLM login dialog, etc.). You can use the WebBrowser.IsBusy property to detect these states.
If due to a currently incomplete navigation action, you could try to stop the current navigation (if you indeed want to stop when the page is not completed loaded) or add the new navigation to a request queue and use a timer to wait until WebBrowser.IsBusy returns false.
If instead the busy state is due to one or more open blocking dialogs, you could do the same wait technique and perhaps Messagebox.Show() the user a message that pending navigation is delayed due to an open dialog window.



