Why is WebBrowser_DocumentCompleted() firing twice?

前端 未结 9 1363
独厮守ぢ
独厮守ぢ 2020-11-29 08:35

Well, I\'m using a simple webbrowser control to browse to a page, so I need to change the Text of the form while doing so. I\'m using -

private void webBrow         


        
9条回答
  •  萌比男神i
    2020-11-29 09:14

    You can check the WebBrowser.ReadyState when the event is fired:

    if (browser.ReadyState != WebBrowserReadyState.Complete)
        return;
    

    ReadyState will be set to Complete once the whole document is ready.

提交回复
热议问题