views:

409

answers:

4

After a lot of thought and consideration, and Google-ing, I'm hell-bent on creating my own SaveFileDialog.

But I do not know where to start and since I haven't seen anything around the web, I would like to know if anybody has done this before, and what I should look into, or how I might go about doing this? Any help would be greatly appreciated.

Thank you :-)

Baeltazor.

EDIT:


I am wanting to build a new SaveFileDialog because I feel the need (or want) to add more functionality to it. And I also feel that if I build a new one, I'll learn alot more about C# and how the SaveFileDialog works behind the scenes

To be quite honest, I don't like the current SaveFileDialog (Yes, it does the job) but I really do want to add extra functionality to it.

Ah, I don't think that there are any restrictions. I can't say for sure because I'm new to this and don't know what is required or...

+3  A: 

Well a dialog is just a form. Start with a form, add the file system browsing components (listview, drop downs) etc, add your code behind. Its not that difficult but may be tedious, but I'd say a good educational exercise where the you'll learn why you may want to just use the built in one.

Preet Sangha
+7  A: 

Why not extend it instead of creating from scratch?

Shoban
+1  A: 

The SaveFileDialog is part of the operating system and will actually look different on different versions of the OS. There are a lot of ways to customize it, but that is not so easy in a Windows Forms project. It can still be done, but you have to hook into the native Win32 API. If you simply want to play around with Windows Forms and C# you can go ahead and design a form that looks like a SaveFileDialog but you will miss all the goodness of the native dialog.

You can read more about the common open and save as dialog boxes on MSDN, but if you are used to Windows Forms programming you may feel alienated by the native Win32 API. Window Vista has introduced a new common item dialog and the COM based API makes it easier to use in a Windows Forms application.

Martin Liversage
+2  A: 

If you are really really sure you want to create your own version of a SaveFileDialog, I'd recommend not just cloning the existing one. If you make it look like the standard one, people will expect it to behave like the standard one, but there's lots of little details and you probably won't get them all.

You want to avoid The Uncanny Valley of User Interface, so you should make it clear that it isn't trying to be the SaveFileDialog + some-new-bits. It should just achieve the same goal (i.e. choosing where to save something).

If you do want to create SaveFileDialog + some-new-bits, then going down the path of extending the dialog as Shoban says is the way to go.

NOTE: None of this really applies if all you want to do is build your own for learning purposes, and then throw it away when you're doing. But if you ever want to use it a real project, then you should keep this in mind.

Wilka
+1 for: If you make it look like the standard one, people will expect it to behave like the standard one
Nifle