Sunday, March 29, 2009

VB.Net OpenFileDialog

OpenFileDialog in VB.Net allows the user to browse for a file and open it.

Properties of the OpenFileDialog are as follows:
  • AddExtension: Gets/Sets if the dialog box adds extension to file names if the user doesn't supply the extension.
  • CheckFileEixsts: Checks whether the specified file exists before returning from the dialog.
  • CheckPathExists: Checks whether the specified path exists before returning from the dialog.
  • DefaultExt: Allows you to set the default file extension.
  • FileName: Gets/Sets file name selected in the file dialog box.
  • FileNames: Gets the file names of all selected files.
  • Filter: Gets/Sets the current file name filter string, which sets the choices that appear in the "Files of Type" box.
  • FilterIndex: Gets/Sets the index of the filter selected in the file dialog box.
  • InitialDirectory: This property allows to set the initial directory which should open when you use the OpenFileDialog.
  • MultiSelect: This property when set to True allows to select multiple file extensions.
  • ReadOnlyChecked: Gets/Sets whether the read-only checkbox is checked.
  • RestoreDirectory: If True, this property restores the original directory before closing.
  • ShowHelp: Gets/Sets whether the help button should be displayed.
  • ShowReadOnly: Gets/Sets whether the dialog displays a read-only check box.
  • Title: This property allows to set a title for the file dialog box.
  • ValidateNames: This property is used to specify whether the dialog box accepts only valid file names.

No comments:

Post a Comment