I am testing if my WebBrowser is complete:
webBrowser2.DocumentCompleted += (s, e) => { // Do stuff }
The webpage I am accessing is like a lot of JS and iframes files, etc., so I use the following function to make sure it really loads.
webBrowser2.DocumentCompleted += (s, e) => { if (e.Url.AbsolutePath != (s as WebBrowser).Url.AbsolutePath) { return; } // Do stuff }
However, it still does not work. Am I doing something wrong or is it syntactically correct and is there some other error in my code?
source share