自定義控件的一些Attribute

1、[Browsable(bool)] :參數爲true時,屬性編輯器中可見,反之不可見;

2、[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] :自定義類型屬性需要序列化編輯器中才可編輯

3、[CategoryAttribute]:屬性分組;

4、[DevaultValueAttribute]:屬性的默認值,當此值有變更時,會在designer.cs文件中生成設計代碼,否則不生成,此屬性用於減少設計文件中的代碼量,另外,當用戶改變了該屬性的值時,粗體顯示該屬性,用以表示,該屬性當前值非默認;

5、[DescriptionAttribute]:可以指定要在“屬性”窗口中顯示的對屬性或事件的說明;

 

 

設計器資料:

 

EditorAttribute 類:

http://msdn.microsoft.com/zh-cn/library/system.componentmodel.editorattribute(v=VS.90).aspx

 

DesignerAttribute 類:

http://msdn.microsoft.com/zh-cn/library/system.componentmodel.designerattribute(v=VS.90).aspx

 

如何:實現類型轉換器:

http://msdn.microsoft.com/zh-cn/library/ayybcxe5(v=VS.90).aspx

 

如何:實現用戶界面類型編輯器:

http://msdn.microsoft.com/zh-cn/library/53c49eck(v=VS.90).aspx

 

如何:應用 Windows 窗體控件中的屬性:

http://msdn.microsoft.com/zh-cn/library/ms171726(v=VS.90).aspx

 

演練:實現 UI 類型編輯器:

http://msdn.microsoft.com/zh-cn/library/ms171840(v=VS.90).aspx

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章