Save File Dialog Control in VB.NET
SaveFileDialog Control allows user to:
(1) Specify Location where to save the file.
(2) Specify Name of File by which it is saved.
Properties of Save File Dialog Control in VB.NET
| Property | Purpose | ||||||
AddExtension |
It is used to specify weather default extension will be automatically added at the end of file name or not. It has Boolean value. Default value is true. |
||||||
CheckFileExists |
It is used to specify weather warning message will display or not if user select a file that does not exist. It has Boolean value. Default value is true. |
||||||
CheckPathExists |
It is used to specify weather warning message will display or not if user specified path does not exist. It has Boolean value. Default value is true. |
||||||
CreatePrompt |
It is used to specify weather SaveFileDialog Control will display warning message or not when user is about to create a new file that does not exist. It has Boolean value. Default value is false. |
||||||
DefaultExt |
It is used to specify default extension for file name. Default extension is appended at the end of file name if user selects file with no extension. |
||||||
FileName |
It represents full path of the file that is selected by user in the SaveFileDialog Control. |
||||||
Filter |
It is used to specify which type of files will be display in the SaveFileDialog Control. |
||||||
FilterIndex |
It is used to specify which File Type to be displayed in SaveFileDialog Control by default. It is used when user specify more than one File Types in Filter Property. In such situation the first File Type in Filter property becomes default File Type and it has FilterIndex 1, the second File Type has FilterIndex 2 and So on. |
||||||
InitialDirectory |
It is used to specify initial directory for SaveFileDialog Control. Initial Directory means the folder whose files are displayed by the SaveFileDialog Control when it opens. |
||||||
OverwritePrompt |
It is used to specify weather SaveFileDialog Control will display warning message or not when user is about to overwrite already existing file. It has Boolean value. Default value is true. |
||||||
Title |
It is used to specify the text to be display in the title bar of the SaveFileDialog Control. |
||||||
Methods of Save File Dialog Control in VB.NET
| Method | Purpose |
ShowDialog |
It is used to Show or run SaveFileDialog Control. |
Reset |
It is used to reset all the properties of SaveFileDialog to its default values. |
OpenFile |
It is used to open the file which is selected by user in read/write mode. |
Events of Save File Dialog Control in VB.NET
| Event | Purpose |
FileOk |
It is the default event of SaveFileDialog Control. It fires each time user clicks on Save button of SaveFileDialog Control. It is used to perform specific task when user click on Save button. |