16

Quite curious, but was just wondering if anyone knows the difference between using:

System.Windows.Forms.SaveFileDialog (in Assembly System.Windows.Forms.dll) and Microsoft.Win32.SaveFileDialog(in Assembly PresentationFramework.dll)?

I use the PresentationFramework.dll version within the WPF form, but am currently re-using some old code in the form which includes showing the System.Windows.Forms.dll version and wondering if:

  1. there is a subtle difference between their appearance?
  2. any interoperability issues with using the System.Windows.Forms.SaveFileDialog? Or are both these just win32 dialogs anyway?
  3. is this just to do with using Microsoft.Win32.SaveFileDialog has issues in windows vista?

Thanks in advance.

Jeb
  • 3,689
  • 5
  • 28
  • 45

1 Answers1

24

Here's a better explanation (might be out of date/irrelevant for later versions of .NET):

http://www.thomasclaudiushuber.com/blog/2008/04/12/vistas-savefiledialog-and-openfiledialog-in-wpf/


While they essentially do the same thing...they're different wrappers...around the WIN32 functionality.

However, there are a number of potential bugs in the WPF (Microsoft.Win32) version of the SaveFileDialog.

How to extend WPF Open/Save Dialogs:

If you want more updated versions of the "Common" file dialogs (e.g. Windows 7 style ones) you can use the "Windows API Code Pack" (some of this has been rolled into .NET 4):

So, which one you choose depends on your needs....if you aren't doing any customizations then you could get away with the Windows.Forms one.

Note using the Windows.Forms one will bloat your application a bit with an extra DLL.

Community
  • 1
  • 1
Colin Smith
  • 12,375
  • 4
  • 39
  • 47
  • Thanks - that's very useful. I have so far found no problems with using both types through my WPF form, and I don't need to worry about Vista, so looks like I am immune to most of the issues. – Jeb Sep 07 '12 at 10:32
  • I really recommend the Windows API Code Pack. Try it out for the features. (For example, the TaskDialog. Why is WPF's MessageBox.Show so ugly compared to Windows Vista/7/8?) – AkselK Sep 07 '12 at 10:59
  • 1
    Is this answer still up to date? – rollsch Nov 21 '19 at 06:24