答案 0 :(得分:3)
使用“编辑器”属性指定属性的编辑器。确保在项目中引用了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;
}
}