Viewing folder paths

Jan 19, 2011 at 10:11 PM

Hi,

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.

Thanks,

Alan

Coordinator
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

Objo,

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?

Alan

Jan 20, 2011 at 1:00 PM

Objo,

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

Sorry

Alan