FileDialog AddExtension bug?

  • Thread starter Thread starter Joel Moore
  • Start date Start date
J

Joel Moore

I've got SaveFileDialog.AddExtension set to True.

I've got SaveFileDialog.Filter set to "JPG Image (*.jpg)|*.jpg|PNG Image
(*.png)|*.png"

If I invoke this dialog and type a file name like "test file.whatever" the
dialog does not append the extension for the currently selected filter
(.jpg or .png). It assumes the ".whatever" is the extension.

Shouldn't it detect that ".whatever" isn't one of the extensions in the
filter and add the currently selected extension to the returned filename?

Joel Moore
 
I've got SaveFileDialog.AddExtension set to True.

I've got SaveFileDialog.Filter set to "JPG Image (*.jpg)|*.jpg|PNG Image
(*.png)|*.png"

If I invoke this dialog and type a file name like "test file.whatever" the
dialog does not append the extension for the currently selected filter
(.jpg or .png). It assumes the ".whatever" is the extension.

Shouldn't it detect that ".whatever" isn't one of the extensions in the
filter and add the currently selected extension to the returned filename?

Joel Moore

I believe I remember seeing a property on the SaveFileDialog named
SupportMultiDottedExtensions and wondering what it was for. I think you may
have answered that question. It's default setting is false. Try setting it to
true and see if that solves your problem. NOTE: It may be a feature of .NET
2.0.
Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
Back
Top