Click to See Complete Forum and Search --> : Displaying thumnails in OpenFileDialog


HalD
August 4th, 2009, 05:12 PM
Is there a way to make the OpenFileDialog display thumbnails when it initially opens instead of the list format. I know I can click on the view icon and change to thumbnail view but I would like the dialog to open in thumbnail view automatically?

Thanks in advance,
Hal

Benholio
August 10th, 2009, 12:36 PM
I don't know of any simple way to do this, but better programmers have tackled this problem and come up with some solutions that aren't too complicated.

Here is a pretty good one at CodeProject: http://www.codeproject.com/KB/dialog/FileDialogExtender.aspx

HalD
August 10th, 2009, 11:51 PM
Thanks for the reply. This works for Windows Forms applications but when I tried it with my WPF application I get the following build error:

WndProc(ref System.Windows.Forms.Message); no suitable method to override.

I included a using for System.Windows.Forms and added the reference.

Regards,
Hal

Benholio
August 11th, 2009, 12:51 PM
Ah, you are right. There would need to be some work done to handle the Win32 hook in WPF. I'm not sure exactly how that would be done, but here are some relevant links. Sorry I couldn't be of more help!

http://support.microsoft.com/kb/Q318804
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6b97a6de-0480-4339-8ed0-cb7cdb27bd83/