如何添加在 IDE 中显示的带有 3 个点的选择文件夹 属性

How can I add a choose folder property that shows in the IDE with the 3 dots

我想向自定义控件添加如下功能,但我不确定如何操作:

我如何在 c#

使用 "Editor" 属性指定 属性 的编辑器。确保您在项目中引用了 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;
    }
}