Class FolderBrowser
Represents a dialog box that allows the user to choose a folder.
Inheritance
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
public class FolderBrowser : CommonDialog
Constructors
FolderBrowser()
Initializes a new instance of the FolderBrowser class.
Declaration
public FolderBrowser()
FolderBrowser(LocationID)
Initializes a new instance of the FolderBrowser class.
Declaration
public FolderBrowser(LocationID rootLocation)
Parameters
Type | Name | Description |
---|---|---|
LocationID | rootLocation | The root location. |
FolderBrowser(LocationID, String)
Initializes a new instance of the FolderBrowser class.
Declaration
public FolderBrowser(LocationID rootLocation, string descriptionText)
Parameters
Type | Name | Description |
---|---|---|
LocationID | rootLocation | The root location. |
System.String | descriptionText | The description text. |
FolderBrowser(LocationID, String, Boolean, String)
Initializes a new instance of the FolderBrowser class.
Declaration
public FolderBrowser(LocationID rootLocation, string directoryPath, bool selectedOrExpanded, string descriptionText)
Parameters
Type | Name | Description |
---|---|---|
LocationID | rootLocation | The root location. |
System.String | directoryPath | The directory path. |
System.Boolean | selectedOrExpanded | if set to |
System.String | descriptionText | The description text. |
FolderBrowser(String)
Initializes a new instance of the FolderBrowser class.
Declaration
public FolderBrowser(string rootLocationPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | rootLocationPath | The root location path. |
FolderBrowser(String, String)
Initializes a new instance of the FolderBrowser class.
Declaration
public FolderBrowser(string rootLocationPath, string descriptionText)
Parameters
Type | Name | Description |
---|---|---|
System.String | rootLocationPath | The root location path. |
System.String | descriptionText | The description text. |
FolderBrowser(String, String, Boolean, String)
Initializes a new instance of the FolderBrowser class.
Declaration
public FolderBrowser(string rootLocationPath, string directoryPath, bool selectedOrExpanded, string descriptionText)
Parameters
Type | Name | Description |
---|---|---|
System.String | rootLocationPath | The root location path. |
System.String | directoryPath | The directory path. |
System.Boolean | selectedOrExpanded | if set to |
System.String | descriptionText | The description text. |
Properties
BrowseForComputerOnly
Gets or sets a value indicating whether m_BrowseForComputerOnly. Only return computers. If the user selects anything other than a computer, the OK button is grayed.
Declaration
public bool BrowseForComputerOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
BrowseForEverything
Gets or sets a value indicating whether m_BrowseForEverything. The browse dialog box will display files as well as folders.
Declaration
public bool BrowseForEverything { get; set; }
Property Value
Type |
---|
System.Boolean |
BrowseForPrinterOnly
Gets or sets a value indicating whether m_BrowseForPrinterOnly. Only return printers. If the user selects anything other than a computer, the OK button is grayed.
Declaration
public bool BrowseForPrinterOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
BrowseIncludeURL
Gets or sets a value indicating whether m_BrowseIncludeURL. The browse dialog box can display URLs. The UseNewUI and BrowseForEverything flags must also be set.
Declaration
public bool BrowseIncludeURL { get; set; }
Property Value
Type |
---|
System.Boolean |
DescriptionText
Gets or sets Description m_DescriptionText. text to be show under the tree.
Declaration
public string DescriptionText { get; set; }
Property Value
Type |
---|
System.String |
DialogTitle
Gets or sets m_DialogTitle. Text that will be shown as a dialog title
Declaration
public string DialogTitle { get; set; }
Property Value
Type |
---|
System.String |
FilterExtensions
Gets or sets m_FilterExtensions. Specifies file filter extensions.
Declaration
public string[] FilterExtensions { get; set; }
Property Value
Type |
---|
System.String[] |
Remarks
Works only if UseNewUI and BrowseForEverything are set to true.
IsEditBoxDisabled
Gets or sets a value indicating whether m_IsEditBoxDisabled. Defines whether to show path textbox as disabled or not.
Declaration
public bool IsEditBoxDisabled { get; set; }
Property Value
Type |
---|
System.Boolean |
IsEditBoxReadOnly
Gets or sets a value indicating whether m_IsEditBoxReadOnly. Defines whether to show path textbox as read-only or not.
Declaration
public bool IsEditBoxReadOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
NoTranslateTargets
Gets or sets a value indicating whether m_NoTranslateTargets. Don't traverse target as shortcut if true.
Declaration
public bool NoTranslateTargets { get; set; }
Property Value
Type |
---|
System.Boolean |
RestrictToDomain
Gets or sets a value indicating whether m_RestrictToDomain. Do not include network folders below the domain level in the dialog box's tree view control.
Declaration
public bool RestrictToDomain { get; set; }
Property Value
Type |
---|
System.Boolean |
RestrictToFilesystem
Gets or sets a value indicating whether m_RestrictToFilesystem. Only return file system directories. If the user selects folders that are not part of the file system, the OK button is grayed.
Declaration
public bool RestrictToFilesystem { get; set; }
Property Value
Type |
---|
System.Boolean |
RestrictToSubfolders
Gets or sets a value indicating whether m_RestrictToSubfolders. Only return file system ancestors. An ancestor is a subfolder that is beneath the root folder in the namespace hierarchy. If the user selects an ancestor of the root folder that is not part of the file system, the OK button is grayed.
Declaration
public bool RestrictToSubfolders { get; set; }
Property Value
Type |
---|
System.Boolean |
RootLocation
Gets or sets m_RootLocation. path to the root of FolderBrowser tree
Declaration
public LocationID RootLocation { get; set; }
Property Value
Type |
---|
LocationID |
RootPath
Gets or sets m_RootPath Custom path to the folder which will be shown as a start root
Declaration
public string RootPath { get; set; }
Property Value
Type |
---|
System.String |
SelectedDirectory
Gets or sets m_SelectedDirectory. Folder chosen by the user.
Declaration
public string SelectedDirectory { get; set; }
Property Value
Type |
---|
System.String |
ShowEditBox
Gets or sets a value indicating whether m_ShowEditBox. Include an edit control in the browse dialog box that allows the user to type the name of an item.
Declaration
public bool ShowEditBox { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowFullPath
Gets or sets a value indicating whether [show full path].
Declaration
public bool ShowFullPath { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ShowHint
Gets or sets a value indicating whether m_ShowHint. When UseNewDialogStyle is set to true, adds a usage hint to the dialog box in place of the edit box. ShowEditBox sets to true overrides this property.
Declaration
public bool ShowHint { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowNewFolderButton
Gets or sets a value indicating whether m_ShowNewFolderButton. Defines whether include the New Folder button in the browse dialog or not.
Declaration
public bool ShowNewFolderButton { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowShareable
Gets or sets a value indicating whether m_ShowShareable. The browse dialog box can display shareable resources on remote systems. UseNewDialogStyle must also be set to true.
Declaration
public bool ShowShareable { get; set; }
Property Value
Type |
---|
System.Boolean |
ShowStatusText
Gets or sets a value indicating whether m_ShowStatusText. If set to true, enables status text area in the dialog This is not supported when UseNewDialogStyle is set to true.
Declaration
public bool ShowStatusText { get; set; }
Property Value
Type |
---|
System.Boolean |
StartExpandedDirectory
Gets or sets m_StartExpandedDirectory. path to the directory which be expanded when the dialog appears.
Declaration
public string StartExpandedDirectory { get; set; }
Property Value
Type |
---|
System.String |
StartSelectedDirectory
Gets or sets m_StartSelectedDirectory. path to the directory which will be selected when the dialog appears.
Declaration
public string StartSelectedDirectory { get; set; }
Property Value
Type |
---|
System.String |
StatusText
Gets or sets m_StatusText. Status text that can be shown if old dialog style is using and ShowStatusText is set to true.
Declaration
public string StatusText { get; set; }
Property Value
Type |
---|
System.String |
UseNewDialogStyle
Gets or sets a value indicating whether m_UseNewDialogStyle. Use the new user interface. Setting this flag provides the user with a larger dialog box that can be resized.
Declaration
public bool UseNewDialogStyle { get; set; }
Property Value
Type |
---|
System.Boolean |
UseNewUI
Gets or sets a value indicating whether m_UseNewUI. Use the new user interface, including an edit box. This is equivalent to UseNewDialogStyle and ShowEditBox set to true.
Declaration
public bool UseNewUI { get; set; }
Property Value
Type |
---|
System.Boolean |
ValidateSelection
Gets or sets a value indicating whether m_ValidateSelection. If the user types an invalid name into the edit box, the browse dialog box will raise the ValidateFailed event. It is ignored if ShowEditBox is not set to true.
Declaration
public bool ValidateSelection { get; set; }
Property Value
Type |
---|
System.Boolean |
Methods
add_Initialized(FolderBrowserInitializedEventHandler)
Declaration
public void add_Initialized(FolderBrowserInitializedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
FolderBrowserInitializedEventHandler | value |
add_IUnknown(FolderBrowserIUnknownEventHandler)
Declaration
public void add_IUnknown(FolderBrowserIUnknownEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
FolderBrowserIUnknownEventHandler | value |
add_SelectedChanged(FolderBrowserSelectionChangedEventHandler)
Declaration
public void add_SelectedChanged(FolderBrowserSelectionChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
FolderBrowserSelectionChangedEventHandler | value |
add_ValidateFailed(FolderBrowserValidateFailedEventHandler)
Declaration
public void add_ValidateFailed(FolderBrowserValidateFailedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
FolderBrowserValidateFailedEventHandler | value |
EnableOkButton(Boolean)
Enables or disables OK button. Works only after the dialog has been shown.
Declaration
public void EnableOkButton(bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enabled | If true - enables, false - disables OK button |
ExpandFolder(String)
Expands the specified folder. Works only after the dialog has been shown.
Declaration
public void ExpandFolder(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Folder path. |
remove_Initialized(FolderBrowserInitializedEventHandler)
Declaration
public void remove_Initialized(FolderBrowserInitializedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
FolderBrowserInitializedEventHandler | value |
remove_IUnknown(FolderBrowserIUnknownEventHandler)
Declaration
public void remove_IUnknown(FolderBrowserIUnknownEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
FolderBrowserIUnknownEventHandler | value |
remove_SelectedChanged(FolderBrowserSelectionChangedEventHandler)
Declaration
public void remove_SelectedChanged(FolderBrowserSelectionChangedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
FolderBrowserSelectionChangedEventHandler | value |
remove_ValidateFailed(FolderBrowserValidateFailedEventHandler)
Declaration
public void remove_ValidateFailed(FolderBrowserValidateFailedEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
FolderBrowserValidateFailedEventHandler | value |
Reset()
Resets properties of FolderBrowser to their default values.
Declaration
public override void Reset()
RunDialog(IntPtr)
Runs a common dialog box with the specified owner.
Declaration
protected override bool RunDialog(IntPtr hwndOwner)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | hwndOwner | Owner IntPtr |
Returns
Type | Description |
---|---|
System.Boolean | bool value type |
SelectFolder(String)
Selects the specified folder. Works only after the dialog has been shown.
Declaration
public void SelectFolder(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Folder path |
SetOkText(String)
Sets OK button text. Works only after the dialog has been shown.
Declaration
public void SetOkText(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Specified text |
SetStatusText(String)
Sets status text. Works only after the dialog has been shown and old dialog style is used.
Declaration
public void SetStatusText(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | Specified text |
Events
Initialized
Occurs when this FolderBrowser is initialized.
Declaration
public event FolderBrowserInitializedEventHandler Initialized
Event Type
Type |
---|
FolderBrowserInitializedEventHandler |
IUnknown
Occurs after initializing and gives a pointer to IUnknown interface.
Declaration
public event FolderBrowserIUnknownEventHandler IUnknown
Event Type
Type |
---|
FolderBrowserIUnknownEventHandler |
SelectedChanged
Occurs when the user changes his selection.
Declaration
public event FolderBrowserSelectionChangedEventHandler SelectedChanged
Event Type
Type |
---|
FolderBrowserSelectionChangedEventHandler |
ValidateFailed
If the property ShowEditBox is true, meaning you let the user enter string, and the user enters an invalid string (the folder he entered does not exists) the shell will notify you of this.
Declaration
public event FolderBrowserValidateFailedEventHandler ValidateFailed
Event Type
Type |
---|
FolderBrowserValidateFailedEventHandler |