using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace winTest { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.Shown += Form1_Shown; } void Form1_Shown(object sender, EventArgs e) { for (int i = 0; i < 20; i++) { UCGroupItems gitem = new UCGroupItems("G_" + i.ToString()); gitem.Name = "G_" + i.ToString(); gitem.Text = gitem.Name; for (int j = 0; j < 10; j++) { UCItems item = new UCItems("DTTTTT",i*j); gitem.Add(item); } this.Controls.Add(gitem); } } } }