.net - 在属性网格中添加编辑文本下拉列表

我正在编写一个类,其属性可通过属性面板访问,其中一个属性是多行文本。

我希望在此属性面板的设计器中显示一个下拉列表,以便用户填写多行文本,就像 Visual Studio 中的 Label 或 TextBox 一样。

我应该将哪个属性放在我的属性定义之上以允许这样做?

最佳答案

您想用 System.ComponentModel.Design.MultilineStringEditor 修饰“文本”属性.

例如

[Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
public string Text { .... }

https://stackoverflow.com/questions/12173421/

相关文章:

regex - 在 Dreamweaver 中自动执行多个正则表达式搜索/替换查询

ruby-on-rails-3 - heroku rails logging 不显示输出?

qt - 添加一个节点到 QDomNodeList

.net - 如何正确标记代码指标的设计器代码以忽略它

jsf - Primefaces 命令按钮 : f:attribute does not work

parsing - AT+CMGL指令异常消息如何处理

php - Smarty gettext 本地化

selenium - geb StaleElementReferenceException

php - 是否可以将图像存储在用户的浏览器上

ruby-on-rails - 在Mongoid中如何找到字段数组计数大于一定数量的所有记录?