Define custom design time editor in a usercontrol (e.g. multiline text) in compact framework 3.5

99封情书 提交于 2019-12-12 09:46:09

问题


In .NET I would just write

[Editor(typeof(System.ComponentModel.Design.MultilineStringEditor), typeof(System.Drawing.Design.UITypeEditor))]
public string MultiLineText { get; set; }

to get the multiline editor for a string property.

However, in Compact Framework this is not possible because System.ComponentModel is not included. I already have a DesigntimeAttributes.xmta file and I suppose I have to define it here but I can't find an example on how to achive this.


回答1:


The following xmta entry does the trick on my VS2008:

<Property Name="MultiLineText">
  <Browsable>true</Browsable>
  <Editor>
    <BaseType>System.Drawing.Design.UITypeEditor, System.Drawing</BaseType>
    <Type>System.ComponentModel.Design.MultilineStringEditor, System.Design</Type>
  </Editor>
</Property>


来源:https://stackoverflow.com/questions/35475299/define-custom-design-time-editor-in-a-usercontrol-e-g-multiline-text-in-compa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!