I have a code that will download a file using
WebBrowser component is a wrapper around Internet Explorer, which downloads asynchronously. Now we could come up with various hacks that would answer your question and maybe solve the problem, but I strongly suggest to use a different approach to download a file, at least if there's no other reason for you to keep WebBrowser in your application:
WebClient.DownloadFile "This method blocks while downloading the resource".
Public Sub Download(address As String, localfile As String) Using client As New System.Net.WebClient() client.DownloadFile("some url", "local file path to save") End Using End Sub
You also can use
WebClient.DownloadFileAsync which doesn't block UI.