I’ll start by mentioning that I’m stuck with the stock WebBrowser .NET control so using Gecko or any other alternative is not an option.
I currently have a simple form with an embedded WebBrowser control. In another screen, the user selects a file to open, this form pops up and shows the document in the WebBrowser. The problem is that, if the file format is supported by this control (say, a JPEG file), it displays properly ; if it’s unsupported (TIFF file, for instance), I get the usual “Do you want to open or save this file?” dialog and then the WebBrowser displays a “Navigation to the webpage was canceled” page. I don’t want this.
What I want to achieve is that, only in the second case, when the user has made his choice and an external program opens the file, my form simply closes instead of displaying that page. Is there any event I can handle to achieve this? Is there any possible workaround? Is this even possible?
Thank you all very much for your time.
Maybe you can catch the FileDownload-Event and close it then