private CheckboxCollection _check_box_items; /// <summary> /// 指定复选框按钮集合 /// </summary> [Category("7510skin-复选按钮组"),Description("指定复选按钮集合")] [TypeConverter(typeof(System.ComponentModel.CollectionConverter))] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public CheckboxCollection CheckBoxItems { get { if (this._check_box_items == null) this._check_box_items = new CheckboxCollection(this); return this._check_box_items; } }
在控件定义一个集合属性,必须添加:
[TypeConverter(typeof(System.ComponentModel.CollectionConverter))]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]