That may work, but I suspect it is just a hack that allows it to do so.
Most likely you have not synchronized the code execution to the UI thread and are creating the new form on a thread different than the primary UI thread.
I may have this following explanation a bit wrong, but the ShowDialog method creates a new message loop for the form to run in thus allowing this to look as though it is working. Most likely you are able to interact with the form that executes the ShowDialog method and this is not normal behavior.
Oh, well now to try and give you something to correct the issue. Instead of using:
Code:
WebClient.DownloadFileAsync(Uri, String)
to start the download, use the overload that allows you to pass a synchronization object
Code:
WebClient.DownloadFileAsync(Uri, String, Object)
. This synchronization object can be the current form instance represented by the "Me" keyword.
Code:
WebClient.DownloadFileAsync(new uri("path to download"), "save path", Me)