private System.Collections.ArrayList list;
[System.ComponentModel.Category("someCategory")]
public System.Collections.ArrayList List
{
get { return list; }
set { list = value; }
}就这个意思,详细情况看 System.ComponentModel 下的 Attribute 派生类。什么 Designer、Builder,都是对这些方面的支持,里面也有例子。

解决方案 »

  1.   

    did you try to add an attribute for your property[DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)] also see56.11 How can I persist a collection of items into code?
    http://www.syncfusion.com/FAQ/WinForms/FAQ_c81c.asp#q713qalso see
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/custcodegen.asp
      

  2.   

    to:saucer(思归)
    现在集合中的对象能产生了,但是我将控件删除后,产生的对象还在
    this.contentSerializationExampleControl1 = new DesignerSerializationVisibilityTest.ContentSerializationExampleControl();
    this.table1 = new DesignerSerializationVisibilityTest.Table();
    this.SuspendLayout();
    // 
    // contentSerializationExampleControl1
    // 
    this.contentSerializationExampleControl1.Dimensions.FormSize = new System.Drawing.Size(150, 150);
    this.contentSerializationExampleControl1.Dimensions.Location = new System.Drawing.Point(56, 40);
    this.contentSerializationExampleControl1.Location = new System.Drawing.Point(56, 40);
    this.contentSerializationExampleControl1.Name = "contentSerializationExampleControl1";
    this.contentSerializationExampleControl1.TabIndex = 0;
    this.contentSerializationExampleControl1.Tables.AddRange(new DesignerSerializationVisibilityTest.Table[] {
     this.table1});
    // 
    // table1
    // 
    this.table1.Location = new System.Drawing.Point(0, 0);
    this.table1.Name = "table1";
    this.table1.TabIndex = 0;
    this.table1.TableName = null;
    this.table1.Text = "table1";
    删除后:
    this.table1 = new DesignerSerializationVisibilityTest.Table();
    // 
    // table1
    // 
    this.table1.Location = new System.Drawing.Point(0, 0);
    this.table1.Name = "table1";
    this.table1.TabIndex = 0;
    this.table1.TableName = null;
    this.table1.Text = "table1";
    怎样解决此问题?
      

  3.   

    so the items are not removed, are you writing your collectioneditor?