winform 自定义控件使用自定义属性List对象,在属性窗口编辑数据点击确定后,设计窗体的自定义控件数据不会刷新,要点一下窗体才会刷新,要怎样才会修改数据后就更新了呢?
/// <summary>
/// 显示项
/// </summary>
List<string> showstring = new List<string> { "1", "2", "3" };
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor("System.Windows.Forms.Design.StringCollectionEditor, System.Design", "System.Drawing.Design.UITypeEditor, System.Drawing")]
[TypeConverter(typeof(System.ComponentModel.CollectionConverter))]
[Browsable(true), Category("自定义属性"), Description("显示的内容")]
public List<string> ShowItemStr
{
get
{
return showstring;
}
set
{
showstring = value;
this.Update();
this.Refresh();
}
}