How to wait until WebBrowser is completely loaded in VB.NET?
I am using the WebBrowser control in my VB.NET application to load a few URLs ( ~10-15) and save their HTML source in a text file. However, my code doesn't write the source of the current page rather the initial one because the it is triggered even before the page is loaded. How can I wait until the page is completely loaded before calling any event? I tried the following code but it doesn't work. Do Until WebBrowser1.ReadyState = WebBrowserReadyState.Complete Application.DoEvents() Loop Sounds like you want to catch the DocumentCompleted event of your webbrowser control. MSDN has a couple of