Open File Dialog Control in VB.NET

Open File Dialog Control allows user to select a file for open.

Properties of Open 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.

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 OpenFileDialog Control.

     

Filter

It is used to specify which type of files will be display in the OpenFileDialog Control.
If user wants to display only executable files than user can set Filter Property to  Executable File | *.exe 
If user wants to display executable files and Image Files than user can set Filter Property to  Executable File | *.exe  | Image Files| *.jpeg

FilterIndex

It is used to specify which File Type to be displayed in OpenFileDialog 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 OpenFileDialog Control. Initial Directory means the folder whose files are displayed by the OpenFileDialog Control when it opens. 

MultiSelect

It is used to specify weather multiple files can be selected from OpenFileDialog control or not. It has Boolean value. Default value is false.

ShowReadOnly

It is used to specify weather “Open as read only” checkbox will be displayed in OpenFileDialog control or not. It has Boolean value. Default value is false.

ReadOnlyChecked

It is used to specify weather “Open as read only” checkbox is selected or not when OpenFileDialog control is open. It has Boolean value. Default value is false.

Title

It is used to specify the text to be display in the title bar of the OpenFileDialog Control.


Methods of Open File Dialog Control in VB.NET


Method Purpose

ShowDialog

It is used to Show or run OpenFileDialog Control.                            

Reset

It is used to reset all the properties of OpenFileDialog to its default values.

OpenFile

It is used to open the file which is selected by user in read only mode.


Events of Open File Dialog Control in VB.NET


Event Purpose

FileOk

It is the default event of OpenFileDialog Control. It fires each time user clicks on Open button of OpenFileDialog Control. It is used to perform specific task when user click on Open button.


Download Projects


Download Programs