最佳答案
使用“编辑器”属性指定属性的编辑器。确保您在项目中引用了 System.Design.dll。
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
[Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string SelectedPath
{
get;
set;
}
}
关于c# - 如何添加在 IDE 中显示的带有 3 个点的选择文件夹属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36380302/