我使用緊湊框架3.5和Pocket PC 2003平臺。C#和CF:設計時間屬性
我在寫我的應用程序自定義控制。我希望將某些屬性作爲設計時屬性公開。
它在MSDN描述(http://msdn.microsoft.com/en-us/library/tk67c2t8.aspx)的方式是不實際工作。
我得到:
類型或命名空間名稱「的CategoryAttribute」找不到(是否缺少using指令或程序集引用
我使用智能感知看? 。什麼屬性我可以寫它列出像一些奇怪的事情:
- EditorBrowsable
- 德signerCategory
- 默認值
- DesignTimeVisible
還有更多。如果我嘗試使用這些這樣:
public partial class Counter : UserControl
{
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerCategory("Data")]
[DesignTimeVisible(true)]
[DefaultValue(0)]
public UInt64 theNumber;
..我得到以下錯誤:
屬性「DesignerCategory」不是 在此聲明類型有效。這是 僅適用於「類」的聲明。
屬性'DesignTimeVisible'不是 對此聲明類型有效。它是 只對'class,interface' 聲明有效。
什麼是使用設計時間屬性的正確方法?