Sdílet prostřednictvím


SaveFileDialog.DefaultExt Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the default file name extension applied to files that are saved with the SaveFileDialog.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property DefaultExt As String
public string DefaultExt { get; set; }

Property Value

Type: System.String
The default file name extension applied to files that are saved with the SaveFileDialog, which can optionally include the dot character (.).

Remarks

The default file name extension is applied when the selected filter does not specify an extension (or the Filter property is not set) and the user does not specify an extension. For example, if the DefaultExt property is set to .my, the selected item in the Save as type drop-down list has a filter string set to All Files|*.*, and a file name without a extension is specified in the File name box, the file is saved with the .my extension.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.