Disable buttons in SaveFileDialog

Cecilia

Member
Joined
Aug 14, 2007
Messages
24
Programming Experience
Beginner
I have a question when using SaveFileDialog, I want to disable the two change folder buttons on top of the dialog, one is to go to the parent folder of the current one, the other is to create a new folder under the current one. In one word, I don't want the user to be able to save the file to any other folder, but the default folder I define. Any one knows how to do that? Thanks a lot.
 
Then why use a SaveFileDialog in the first place? Just make a form that the user can type a filename into and append it to your specified path.
 
Because it will cause quite some changes. But if there is no way to disable those two buttons, I guess that is my only choice.

Thanks for your reply.
 
The proper way would be to quickly make you're own form for allowing the user to enter a file name and wiring up the file handling to that, especially from the standpoint of the end user, if you were to give them a save file dialog then they would expect to be able to save the file to any directory they want. Not to mention that even if you were to disable those two buttons, the user can type any path they want to in the save file dialog's filename textbox and the dialog will validate that path (make sure it exists and whatnot) so disabling just the two buttons wont be enough to prevent the advanced users from saving the file to any location they want unless you completely override the SaveFileDialog control yourself.

This subsequently means you're writing your own dialog anyways, so why not just make your own dialog right now to get a file name and handle things properly.
 
Back
Top