Tuesday, December 30, 2008

OpenDialogEx Modified - Now allows you to choose directory in .NETCF

Hi Guys,

 I'm modifying my SmartProtect code to allow my application to choose folders that can be protected. However, currently, .NETCF does not have any FolderBrowserDialog method so there's no way for you to browse folders.

Instead of re-inventing the wheel, I was looking for codes that I can freely integrate and modify to so that it is able to choose folders instead of just files and I saw a post from http://www.mobilepractices.com/2008/02/custom-openfiledialog-implementation.html. (Anyway I've seen Mr. Peter Foot's one but I feel this implementation is cleaner and much more easier to scale)

However, this implementation does not allow you to choose folder so since the author allows us to freely modify the code, I did some modification to allow it to choose Folders instead of just Files. The modified code is here : 


To use this code so that you can filter out the folders, just add :

filter.dialog="(Directory)";

the code will then filter only the directory and it will allow you to select the folders.

Anyway, I've also added a bonus. You can change the title of the form by adding filter.title="Choose a Folder"

Thanks to José Gallardo Salazar for a very good code. 

1 comment:

  1. This link: http://members.lycos.co.uk/mayo98/OpenFileDialogSample.SourceCodeV2.zip

    is broken. Could you please put it somewhere else? thanks!

    ReplyDelete