private void Form1_Load(object sender, System.EventArgs e)
{
ComboBox c = new ComboBox();
c.Location = new System.Drawing.Point(0,0);
c.Size = new System.Drawing.Size(150, 20);
c.Text = "aaaaaaaaaaa";
for(int i=0;i<3;i++)
{
ComboBox a = c;
a.Location = new System.Drawing.Point(0,i*25);
this.Controls.Add(a);
}
}
只出来一个
{
ComboBox c = new ComboBox();
c.Location = new System.Drawing.Point(0,0);
c.Size = new System.Drawing.Size(150, 20);
c.Text = "aaaaaaaaaaa";
for(int i=0;i<3;i++)
{
ComboBox a = c;
a.Location = new System.Drawing.Point(0,i*25);
this.Controls.Add(a);
}
}
只出来一个
这句应该是new吧,否则的话一共只有C这么一个控件,你最后看到的结果应该是对的