上一章遗留的DefaultValueAttribute问题,还没有找到问题所在,我会继续查找资料,找到后会及时补上。
        今天我们讲Component  Property Editor UI,在vs环境中Property Editor有两种,一种是vs自带的,一种是Component编写者根据自己需求而重新编写的。在本章中我们这两种都会进行一个简单的学习,vs自带的主要讲Collection Editor。
        先来回顾下我们上章没有讲的几个PropertyAttribute:
        EditorAttribute:指定Property Editor使用的编辑器。
        DesignerSerializationVisibilityAttribute:指定通过Property Editor得到的结果是否保存在代码中。
        LocalizableAttribute:用户要本地化某个窗体时,任何具有该特性的属性都将自动永久驻留到资源文件中。
        代码实例如下,请注意代码中注释说明。

.NET组件编程(3) Property Editorusing System;
.NET组件编程(3) Property Editor
using System.Collections.Generic;
.NET组件编程(3) Property Editor
using System.Collections;
.NET组件编程(3) Property Editor
using System.Text;
.NET组件编程(3) Property Editor
using System.ComponentModel;
.NET组件编程(3) Property Editor
using System.ComponentModel.Design;
.NET组件编程(3) Property Editor
using System.Drawing;
.NET组件编程(3) Property Editor
using System.Drawing.Design;
.NET组件编程(3) Property Editor
using System.Windows.Forms;
.NET组件编程(3) Property Editor
using System.Windows.Forms.Design;
.NET组件编程(3) Property Editor
.NET组件编程(3) Property Editor
namespace Components
}


Property Editor效果如下:

.NET组件编程(3) Property Editor
.NET组件编程(3) Property Editor 

下载源代码

相关文章: