Prompts the user to select a location for saving a file on the server.
This class can either open and overwrite an existing file or create a new file.
Most of the functionality for this class is found in the FileDialog class.
The SaveFileDialog is able to filter the types of files shown to the user based on a given pattern. For example, the filter Image Files|.jpg|All files|.* will by default show users files in the given directory ending with .jpg. The filter can be modified by changing the selection in the dropdown on the bottom right.
The SaveFileDialog is able to validate whether or not a certain file exists before saving it to the disk. This can help prevent overwriting an existing file.
The SaveFileDialog component has an optional "?" (Help) tool that allows you to process and display information to help users navigate the control.
The SaveFileDialog component can be customized by applying appearances to each individual control within the dialog. This includes the textboxes, picker, and more.
To customize these controls, create a new class that inherits from FileDialogUI, add the custom FileDialog constructor, and modify the controls within it:
public class CustomSaveFileDialogUI : FileDialogUI
public CustomSaveFileDialogUI(SaveFileDialog saveFileDialog) : base(saveFileDialog)
this.HeaderBackColor = Color.DarkOrange;
foreach (ColumnHeader col in this.listView.Columns)
col.BackColor = Color.DarkOrange;
After applying the OpenFileDialog's DialogTemplate property to the new class, the resulting popup will look like this:
For instructions on how to use a custom template to offer advanced customization of the SaveFileDialog, see below.