Frederik Witte
Frederik Witte

Reputation: 955

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.

Upvotes: 0

Views: 74

Answers (2)

BCdotWEB
BCdotWEB

Reputation: 1048

I would assume you can use the WebBrowser.DocumentCompleted Event

Occurs when the WebBrowser control finishes loading a document.

Upvotes: 2

dav_i
dav_i

Reputation: 28107

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.

Upvotes: 4

Related Questions