对于一个运行在Windows Mobile上的C# UserControl(但如果您知道完整版的Windows,请回答,它可能会起作用),如何更改在Designer属性窗口中显示的控件公共属性的内容。例如:
private Color blah = Color.Black;
public Color Blah
{
get { return this.blah; }
set { this.blah = value; }
}
这会在控件中显示,但它属于“Misc”类别,并且没有描述或默认值。我已经尝试使用System.ComponentModel中的设置,比如“DesignerCategory”,例如:
This shows up for the control, but it's in the "Misc" category and has no description or default value. I've tried using the settings in System.ComponentModel like "DesignerCategory", such as:[DesignerCategory("Custom")]
但是说这仅适用于类声明...我以前使用的应该是System.ComponentModel项...
更新:
@John 说:
DesignerCatogy 用于表示类是否为窗体、组件等。
尝试这个:
[Category("Custom")]
我需要使用特定的命名空间才能获取它们吗? 我已经尝试了这些,但编译器没有识别它们。
在.NETCF中,我似乎只有从System.ComponentModel中可用的:
DataObject,
DataObjectMethod,
DefaultValue,
DesignerCategory,
DesignTimeVisible,
EditorBrowsable
它唯一不会大声呼喊的是EditorBrowsable