PDA

View Full Version : Replacement OpenFileDialog .NET v2.0


VZ800
17th May 2006, 07:16 PM
I was recently asked how to get the System.Windows.Forms.OpenFileDialog to browse through folders outside of the 'My Documents' folder on a PPC. I said that it was not possible with that dialog. So in the end I wrote this replacement Dialog, which is the start of my a library of functions/dialogs for the .NET Compact Framework v2.0.

I use the eVC4 but the person who asked for the dialog was using .NET. Having said that the code inside the new dialog uses the CF API and not the Managed objects for enumerating through files and folders. So it is quite quick.

I have also exposed a couple of classes for getting the associated icon to a file type, and returns the icon index for an imagelist etc.

This is my first attempt at writing for the PPC. Although I am a professional C++/C# programmer.

If anyone else finds this useful, and if anyone requires any additions to this library by all means let me know. I would appreciate feedback.

NashXDA
18th May 2006, 10:41 AM
Good stuff bro...works like a charm

Thanks

lopez1_de
3rd December 2008, 10:28 AM
Wow. Great thing. Many thanks.

Works great.

jdbarclay
8th December 2008, 05:23 PM
Works fine except that you can't list multiple filters, for example:

fd.Filter = "Text files|*.txt;*.rtf";

Doesn't work, it won't list any file. Please post if you got a fix for this. Thanks!