简体   繁体   中英

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

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM