CustomPlaces Property

FileDialog.CustomPlaces Property

Gets the custom places collection for this FileDialog instance.

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

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property CustomPlaces As FileDialogCustomPlacesCollection
'Usage
Dim instance As FileDialog 
Dim value As FileDialogCustomPlacesCollection 

value = instance.CustomPlaces

Property Value

Type: System.Windows.Forms.FileDialogCustomPlacesCollection
The custom places collection for this FileDialog instance.

On Windows XP, this property does not have any effect.

The following code example demonstrates how to use the CustomPlaces collection. To run this example, paste the following code into a Windows Form and call InitializeDialogAndButton from the form's constructor or Load event-handling method.

Private openFileDialog1 As OpenFileDialog
Private WithEvents button1 As Button

Private Sub InitializeDialogAndButton() 
    Me.openFileDialog1 = New System.Windows.Forms.OpenFileDialog()
    Me.button1 = New System.Windows.Forms.Button()
    Me.button1.Location = New System.Drawing.Point(53, 37)
    Me.button1.AutoSize = True 
    Me.button1.Text = "Show dialog with custom places." 
    Me.button1.UseVisualStyleBackColor = True 

    Me.Controls.Add(Me.button1)

End Sub 


Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) _
    Handles button1.Click

    ' Add Pictures custom place using GUID.
    openFileDialog1.CustomPlaces.Add("33E28130-4E1E-4676-835A-98395C3BC3BB")

    ' Add Links custom place using GUID
    openFileDialog1.CustomPlaces.Add(New FileDialogCustomPlace _
        (New Guid("BFB9D5E0-C6A9-404C-B2B2-AE6DB6AF4968")))

    ' Add Windows custom place using file path.
    openFileDialog1.CustomPlaces.Add("c:\Windows")

    openFileDialog1.ShowDialog()

End Sub

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5 SP1, 3.0 SP1, 2.0 SP1

Community Additions

ADD
Show:
© 2016 Microsoft