MethodItemControl item = new MethodItemControl("1",false);
item.Visible = true;
item.Height = listBox1.ItemHeight;
//item.Dock = DockStyle.Fill;
this.listBox1.Items.Add(item);
this.listBox1.Controls.Add(item);
this.listBox1.Controls.Owner.Refresh();
item = new MethodItemControl("2", false);
item.Visible = true;
item.Height = listBox1.ItemHeight;
this.listBox1.Items.Add(item);
this.listBox1.Controls.Add(item);
item = new MethodItemControl("3", false);
item.Visible = true;
item.Height = listBox1.ItemHeight;
this.listBox1.Items.Add(item);
this.listBox1.Controls.Add(item);
this.listBox1.Controls.Owner.Refresh();
this.listBox1.Refresh();
((MethodItemControl)this.listBox1.Controls[2]).Show();
我测试过,Controls.Count=3, 但是只能显示我的第一个UC, 我已经确保UC。height 比 listbox.itemheight小了。请问各位高手如何解决?