Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
491 lines (445 sloc) 34.2 KB
<Type Name="FolderBrowserDialog" FullName="System.Windows.Forms.FolderBrowserDialog">
<TypeSignature Language="C#" Value="public sealed class FolderBrowserDialog : System.Windows.Forms.CommonDialog" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit FolderBrowserDialog extends System.Windows.Forms.CommonDialog" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.FolderBrowserDialog" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class FolderBrowserDialog&#xA;Inherits CommonDialog" />
<TypeSignature Language="C++ CLI" Value="public ref class FolderBrowserDialog sealed : System::Windows::Forms::CommonDialog" />
<TypeSignature Language="F#" Value="type FolderBrowserDialog = class&#xA; inherit CommonDialog" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Forms.CommonDialog</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultEvent("HelpRequest")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultProperty("SelectedPath")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.FolderBrowserDialogDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.FolderBrowserDialogDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.FolderBrowserDialogDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Prompts the user to select a folder. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This class provides a way to prompt the user to browse, create, and eventually select a folder. Use this class when you only want to allow the user to select folders, not files. Browsing of the folders is done through a tree control. Only folders from the file system can be selected; virtual folders cannot.
Typically, after creating a new <xref:System.Windows.Forms.FolderBrowserDialog>, you set the <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A> to the location from which to start browsing. Optionally, you can set the <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> to an absolute path of a subfolder of <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A> that will initially be selected. You can also optionally set the <xref:System.Windows.Forms.FolderBrowserDialog.Description%2A> property to provide additional instructions to the user. Finally, call the <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> method to display the dialog box to the user. When the dialog box is closed and the dialog box result from <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> is <xref:System.Windows.Forms.DialogResult.OK?displayProperty=nameWithType>, the <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> will be a string containing the path to the selected folder.
You can use the <xref:System.Windows.Forms.FolderBrowserDialog.ShowNewFolderButton%2A> property to control if the user is able to create new folders with the **New Folder** button.
<xref:System.Windows.Forms.FolderBrowserDialog> is a modal dialog box; therefore, when shown, it blocks the rest of the application until the user has chosen a folder. When a dialog box is displayed modally, no input (keyboard or mouse click) can occur except to objects on the dialog box. The program must hide or close the dialog box (usually in response to some user action) before input to the calling program can occur.
## Examples
The following code example creates an application that enables the user to open rich text (.rtf) files within the <xref:System.Windows.Forms.RichTextBox> control.
[!code-cpp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/VB/form1.vb#1)]
]]></format>
</remarks>
<altmember cref="P:System.Windows.Forms.FolderBrowserDialog.RootFolder" />
<altmember cref="P:System.Windows.Forms.FolderBrowserDialog.SelectedPath" />
<altmember cref="M:System.Windows.Forms.CommonDialog.ShowDialog" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FolderBrowserDialog ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.FolderBrowserDialog.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; FolderBrowserDialog();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Forms.FolderBrowserDialog" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The parameterless constructor initializes properties to their default values.
When a new <xref:System.Windows.Forms.FolderBrowserDialog> is created, the <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A> property is set to <xref:System.Environment.SpecialFolder.Desktop?displayProperty=nameWithType>, the <xref:System.Windows.Forms.FolderBrowserDialog.Description%2A> property is set to an empty string (""), the <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> property is set to an empty string, and the <xref:System.Windows.Forms.FolderBrowserDialog.ShowNewFolderButton%2A> property is set to `true`.
Typically, after creating a new <xref:System.Windows.Forms.FolderBrowserDialog>, you set the <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A> to the location from which to start browsing. Optionally, you can set the <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> to the path of a subfolder of <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A> that will initially be selected. You can also optionally set the <xref:System.Windows.Forms.FolderBrowserDialog.Description%2A> property to provide additional instructions to the user. Finally, call the <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> method to display the dialog box to the user. When the dialog box is closed and the dialog result from <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> is <xref:System.Windows.Forms.DialogResult.OK?displayProperty=nameWithType>, the <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> will be a string containing the path to the selected folder.
<xref:System.Windows.Forms.FolderBrowserDialog> is a modal dialog box; therefore, when shown, it blocks the rest of the application until the user has chosen a folder. When a dialog box is displayed modally, no input (keyboard or mouse click) can occur except to objects on the dialog box. The program must hide or close the dialog box (usually in response to some user action) before input to the calling program can occur.
## Examples
The following code example creates an application that enables the user to open rich text (.rtf) files within the <xref:System.Windows.Forms.RichTextBox> control.
[!code-cpp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/VB/form1.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AutoUpgradeEnabled">
<MemberSignature Language="C#" Value="public bool AutoUpgradeEnabled { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AutoUpgradeEnabled" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.FolderBrowserDialog.AutoUpgradeEnabled" />
<MemberSignature Language="VB.NET" Value="Public Property AutoUpgradeEnabled As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool AutoUpgradeEnabled { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AutoUpgradeEnabled : bool with get, set" Usage="System.Windows.Forms.FolderBrowserDialog.AutoUpgradeEnabled" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether the dialog will be automatically upgraded to enable new features.</summary>
<value>
<see langword="true" /> if the the dialog will be automatically upgraded to enable new features; otherwise, <see langword="false" />. The default value is <see langword="true" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Description">
<MemberSignature Language="C#" Value="public string Description { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Description" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.FolderBrowserDialog.Description" />
<MemberSignature Language="VB.NET" Value="Public Property Description As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Description { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Description : string with get, set" Usage="System.Windows.Forms.FolderBrowserDialog.Description" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the descriptive text displayed above the tree view control in the dialog box.</summary>
<value>The description to display. The default is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Windows.Forms.FolderBrowserDialog.Description%2A> property can be used to specify additional information to the user, like instructions.
## Examples
The following code example creates an application that enables the user to open rich text (.rtf) files within the <xref:System.Windows.Forms.RichTextBox> control.
[!code-cpp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/VB/form1.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="HelpRequest">
<MemberSignature Language="C#" Value="public event EventHandler HelpRequest;" />
<MemberSignature Language="ILAsm" Value=".event class System.EventHandler HelpRequest" />
<MemberSignature Language="DocId" Value="E:System.Windows.Forms.FolderBrowserDialog.HelpRequest" />
<MemberSignature Language="VB.NET" Value="Public Custom Event HelpRequest As EventHandler " />
<MemberSignature Language="C++ CLI" Value="public:&#xA; event EventHandler ^ HelpRequest;" />
<MemberSignature Language="F#" Value="member this.HelpRequest : EventHandler " Usage="member this.HelpRequest : System.EventHandler " />
<MemberType>Event</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.EventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the user clicks the **Help** button on the dialog box.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Reset">
<MemberSignature Language="C#" Value="public override void Reset ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Reset() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.FolderBrowserDialog.Reset" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub Reset ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override void Reset();" />
<MemberSignature Language="F#" Value="override this.Reset : unit -&gt; unit" Usage="folderBrowserDialog.Reset " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Resets properties to their default values.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Resets the <xref:System.Windows.Forms.FolderBrowserDialog.Description%2A>, <xref:System.Windows.Forms.FolderBrowserDialog.ShowNewFolderButton%2A>, <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> and <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A> properties to their default values. For a list of default values, see the <xref:System.Windows.Forms.FolderBrowserDialog.%23ctor%2A> constructor.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="RootFolder">
<MemberSignature Language="C#" Value="public Environment.SpecialFolder RootFolder { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Environment/SpecialFolder RootFolder" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.FolderBrowserDialog.RootFolder" />
<MemberSignature Language="VB.NET" Value="Public Property RootFolder As Environment.SpecialFolder" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property Environment::SpecialFolder RootFolder { Environment::SpecialFolder get(); void set(Environment::SpecialFolder value); };" />
<MemberSignature Language="F#" Value="member this.RootFolder : Environment.SpecialFolder with get, set" Usage="System.Windows.Forms.FolderBrowserDialog.RootFolder" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.SpecialFolderEnumConverter))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Environment+SpecialFolder</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the root folder where the browsing starts from.</summary>
<value>One of the <see cref="T:System.Environment.SpecialFolder" /> values. The default is <see langword="Desktop" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Only the specified folder and any subfolders that are beneath it will appear in the dialog box and be selectable. The <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> property, along with <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A>, determines what the selected folder will be when the dialog box is displayed, as long as <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> is an absolute path that is a subfolder of <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A> (or more accurately, points to a subfolder of the shell namespace represented by <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A>).
## Examples
The following code example creates an application that enables the user to open rich text (.rtf) files within the <xref:System.Windows.Forms.RichTextBox> control.
[!code-cpp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/VB/form1.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ComponentModel.InvalidEnumArgumentException">The value assigned is not one of the <see cref="T:System.Environment.SpecialFolder" /> values.</exception>
</Docs>
</Member>
<Member MemberName="RunDialog">
<MemberSignature Language="C#" Value="protected override bool RunDialog (IntPtr hWndOwner);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance bool RunDialog(native int hWndOwner) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Forms.FolderBrowserDialog.RunDialog(System.IntPtr)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function RunDialog (hWndOwner As IntPtr) As Boolean" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override bool RunDialog(IntPtr hWndOwner);" />
<MemberSignature Language="F#" Value="override this.RunDialog : nativeint -&gt; bool" Usage="folderBrowserDialog.RunDialog hWndOwner" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="hWndOwner" Type="System.IntPtr" />
</Parameters>
<Docs>
<param name="hWndOwner">A handle to the window that owns the folder browser dialog.</param>
<summary>Displays a folder browser dialog box.</summary>
<returns>
<see langword="true" /> if the folder browser dialog was successfully run; otherwise, <see langword="false" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="SelectedPath">
<MemberSignature Language="C#" Value="public string SelectedPath { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string SelectedPath" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.FolderBrowserDialog.SelectedPath" />
<MemberSignature Language="VB.NET" Value="Public Property SelectedPath As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ SelectedPath { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.SelectedPath : string with get, set" Usage="System.Windows.Forms.FolderBrowserDialog.SelectedPath" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.SelectedPathEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.SelectedPathEditor, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Windows.Forms.Design.SelectedPathEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the path selected by the user.</summary>
<value>The path of the folder first selected in the dialog box or the last folder selected by the user. The default is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> property is set before showing the dialog box, the folder with this path will be the selected folder, as long as <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> is set to an absolute path that is a subfolder of <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A> (or more accurately, points to a subfolder of the shell namespace represented by <xref:System.Windows.Forms.FolderBrowserDialog.RootFolder%2A>).
If the <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> returns <xref:System.Windows.Forms.DialogResult.OK>, meaning the user clicked the **OK** button, the <xref:System.Windows.Forms.FolderBrowserDialog.SelectedPath%2A> property will return a string containing the path to the selected folder. If <xref:System.Windows.Forms.CommonDialog.ShowDialog%2A> returns <xref:System.Windows.Forms.DialogResult.Cancel>, meaning the user canceled out of the dialog box, this property will have the same value that it had prior to displaying the dialog box. If the user selects a folder that does not have a physical path (for example, My Computer), the **OK** button on the dialog box will be disabled.
## Examples
The following code example creates an application that enables the user to open rich text (.rtf) files within the <xref:System.Windows.Forms.RichTextBox> control.
[!code-cpp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/VB/form1.vb#1)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.FileIOPermission">for getting the path. Associated enumeration: <see cref="F:System.Security.Permissions.FileIOPermissionAccess.PathDiscovery" /></permission>
<altmember cref="P:System.Windows.Forms.FolderBrowserDialog.RootFolder" />
</Docs>
</Member>
<Member MemberName="ShowNewFolderButton">
<MemberSignature Language="C#" Value="public bool ShowNewFolderButton { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool ShowNewFolderButton" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.FolderBrowserDialog.ShowNewFolderButton" />
<MemberSignature Language="VB.NET" Value="Public Property ShowNewFolderButton As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool ShowNewFolderButton { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.ShowNewFolderButton : bool with get, set" Usage="System.Windows.Forms.FolderBrowserDialog.ShowNewFolderButton" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the **New Folder** button appears in the folder browser dialog box.</summary>
<value>
<see langword="true" /> if the **New Folder** button is shown in the dialog box; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When <xref:System.Windows.Forms.FolderBrowserDialog.ShowNewFolderButton%2A> is `true`, the **New Folder** button is visible, giving the user a chance to create a folder. When the user clicks the **New Folder** button, a new folder is created and the user is prompted to specify the folder name. The selected node in the tree becomes the parent of the new folder. The actual caption of the **New Folder** button can vary depending upon the operating system
> [!IMPORTANT]
> Setting <xref:System.Windows.Forms.FolderBrowserDialog.ShowNewFolderButton%2A> to `false` does not work on Windows 2000.
## Examples
The following code example creates an application that enables the user to open rich text (.rtf) files within the <xref:System.Windows.Forms.RichTextBox> control.
[!code-cpp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CPP/form1.cpp#1)]
[!code-csharp[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/CS/form1.cs#1)]
[!code-vb[System.Windows.Forms.FolderBrowserDialog#1](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FolderBrowserDialog/VB/form1.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="UseDescriptionForTitle">
<MemberSignature Language="C#" Value="public bool UseDescriptionForTitle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool UseDescriptionForTitle" />
<MemberSignature Language="DocId" Value="P:System.Windows.Forms.FolderBrowserDialog.UseDescriptionForTitle" />
<MemberSignature Language="VB.NET" Value="Public Property UseDescriptionForTitle As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool UseDescriptionForTitle { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.UseDescriptionForTitle : bool with get, set" Usage="System.Windows.Forms.FolderBrowserDialog.UseDescriptionForTitle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.Browsable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-3.0;netcore-3.1">
<AttributeName>System.ComponentModel.Description("FolderBrowserDialogUseDescriptionForTitle")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether to use the value of the <see cref="P:System.Windows.Forms.FolderBrowserDialog.Description" /> property as the dialog title for Vista style dialogs. This property has no effect on old style dialogs.</summary>
<value>
<see langword="true" /> if the value of the <see cref="P:System.Windows.Forms.FolderBrowserDialog.Description" /> property is used as the dialog title; <see langword="false" /> if the value is added as additional text to the dialog. The default is <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.