PropertyGrid - Possible to have a file/directory s

2020-08-25 05:51发布

问题:

Is it possible to have a file/directory selection button next to a property value in the PropertyGrid? Hitting the button would launch a standard "Open File" or "Select Directory" type of dialog. In a perfect world, this could be done using an Attribute on the SelectedObject's property.

回答1:

Yes, add this attribute to the property.

[EditorAttribute(typeof(FileNameEditor), typeof(UITypeEditor))]