假设我有属性“地址”,我怎样才能像文本框的文本输入一样在表单设计器的属性框中输入它,如下所示:
?
最佳答案
用 EditorAttribute 修饰您的 Address
属性引用 MultilineStringEditor类:
using System.ComponentModel;
using System.Drawing.Design;
[Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
typeof(UITypeEditor))]
public string Address
{
get;
set;
}
关于c# - 使自定义控件的属性输入类似于多行文本框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4125341/