问题
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