Tuesday, November 07, 2006

Customized .Net OpenFileDialog in C#(OpenFileDialogEx)

The Code ProjectCustomizing OpenFileDialog in .Net

"...

How many times had happen where you want to put some extra control in the OpenFileDialog control and you can’t…

Searching for code on the .Net I found a couple places where they used MFC, but nothing for .Net. OpenFileDialog is not native implemented in .Net, instead it make use of a Win32 API “GetOpenFileName”.

a) Create my own OpenFileDialog from scratch.
b) Create my own OpenFileDialog reusing resources, (using the API “GetOpenFileName” and provide my own template)
c) Hack on .Net OpenFileDialog and add the functionality I need for it.

A – Was not an option because it could require a lot of development time when there is a lot more stuff to be done, later when the product is finished I can review this.
B – Required to provide my own template using calls to Win32 API and resources.
C – Was the more viable option at this time, don’t think of this as a bad hack, basically a hack is when you want make the control do some extra functionality and you must from different thread or process.

So because I like the challenges, I decided to “hack” OpenFileDialog class to create my own customizable control. ..."

I was just thinking about a new/tweaked file open dialog (with a large image preview) for my Picture Post WLW Plugin.

Looks like Castor has just saved me a good bit of time... ;)

No comments: