Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

FileDialog.SupportMultiDottedExtensions Property

Gets or sets whether the dialog box supports displaying and saving files that have multiple file name extensions.

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

'Declaration
Public Property SupportMultiDottedExtensions As Boolean

Property Value

Type: System.Boolean
true if the dialog box supports multiple file name extensions; otherwise, false. The default is false.

Sometimes users must open and save files that use multiple file name extensions. For example, the application manifest files used by the ClickOnce deployment technology end in the complex file name extension ".exe.manifest". Setting this property to true enables you to set the Filter property to a multi-dotted extension.

If SupportMultiDottedExtensions is false, and you assign a multi-dotted extension to Filter, derived controls such as SaveFileDialog will only use the last extension in the string. For example, ".manifest" will be used instead of ".exe.manifest".

The following code example saves files with the extension ".data.txt". This code example requires that your application host a SaveFileDialog named saveFileDialog1 and a Button named button1.


Imports System.IO
Imports System.Text

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.SaveFileDialog1.SupportMultiDottedExtensions = True
        Me.SaveFileDialog1.Filter = "Data text files|*.data.txt"
        Me.SaveFileDialog1.ShowDialog()
    End Sub

    Private Sub SaveFileDialog1_FileOk(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
        Try
            Dim MyFile As StreamWriter = New StreamWriter(Me.SaveFileDialog1.OpenFile(), Encoding.Unicode)
            MyFile.WriteLine("Hello, world!")
            MyFile.Close()
        Catch ex As Exception
            MessageBox.Show("Error: Could not write file. Please try again later. Error message: " & ex.Message, "Error Writing File", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        End Try
    End Sub
End Class


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft