System.Windows.Forms.FileDialog.AddExtension Property

Gets or sets a value indicating whether the dialog box automatically adds an extension to a file name if the user omits the extension.

Syntax

[System.ComponentModel.DefaultValue(true)]
public bool AddExtension { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The extension added to a file name depends on the currently selected file filter and the value of the FileDialog.CheckFileExists property.

If the FileDialog.CheckFileExists property is true, the dialog box adds the first extension from the current file filter that matches an existing file. If no files match the current file filter, the dialog box adds the extension specified in the FileDialog.DefaultExt property.

If the FileDialog.CheckFileExists property is false, the dialog box adds the first valid file name extension from the current file filter. If the current file filter contains no valid file name extensions, the dialog box adds the extension specified in the FileDialog.DefaultExt property.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0