WebBrowser.IsBusy 在.Net 4.0中的BUG

来源:互联网 发布:网络不稳定 编辑:程序博客网 时间:2024/05/21 06:46

属性IsBusy在文档中说明(http://msdn.microsoft.com/en-us/library/ek4h3t66(v=VS.100).aspx?appId=Dev10IDEF1&l=EN-US&k=k(SYSTEM.WINDOWS.FORMS.WEBBROWSER.ISBUSY)%3bk(ISBUSY)%3bk(TargetFrameworkMoniker-%22.NETFRAMEWORK&k=VERSION%3dV4.0%22)%3bk(DevLang-CSHARP)&rd=true):
If this property is true, you can use the Stop method to halt the current navigation before the new document is fully loaded. Use the ReadyState property to determine the exact navigation state of the WebBrowser control. The IsBusy property value is false when the ReadyState property value is WebBrowserReadyState.Complete.

但是实际上遇到了IsBusy一直是true,但检查ReadyState即为WebBrowserReadyState.Complete,郁闷了,于是不得已使用
IsBusy && this.ReadyState != WebBrowserReadyState.Complete

来检测是否是忙,或者使用this.ReadyState != WebBrowserReadyState.Complete也得,但为了安全起见还是多写一点吧

原创粉丝点击