简体   繁体   中英

How do I know if a WebBrowser has finished loading a page?

I'm developing a piece of software, where I have created a WebBrowser. I can't figure out how you can check if the WebBrowser has finished loading.

It would be awesome if it could run a specific function when it finishes loading.

Assuming you're using System.Windows.Forms.WebBrowser you can use the DocumentCompleted event :

webBrowser.DocumentCompleted += (sender, event) => DoSomething();

MSDN is a great resource, which should be your first port of call when wondering about Microsoft APIs like this.

I would assume you can use the WebBrowser.DocumentCompleted Event

Occurs when the WebBrowser control finishes loading a document.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM