Viewing folder paths

Jan 19, 2011 at 10:11 PM


I want to display folder paths in the property editor in a text box followed by a button, so that clicking the button will display a folder browser allowing the user to select an alternative folder. Is this possible and if so how would I go about implementing it. Dont yet know anything about custom editors etc. At the back of my mind something is telling me that there is already an attribute that does this but I cannot remember or find it again.



Jan 19, 2011 at 10:25 PM

yes, try the FilePathAttribute:

[FilePath("Text files|*.txt",".txt")]
public string FileName { get; set; }

Jan 20, 2011 at 12:53 PM


FilePath executes an OpenFile Dialog that does not let me select a folder, so I want to be able to run a FolderBrowserDialog instead of the OpenFile Dialog. Is there a way to do this?


Jan 20, 2011 at 1:00 PM


I looked at the source and found DirectoryPicker. Should have done that in the first place.