tablelayoutpanel的一个怪现象,求解!
我在使用tablelayoutpanel遇到这样一个怪现象。动态往tablelayoutpanel添加label的时候,第二个label所在的row不能自动更改大小,成为一条缝。其他全部正常!tablelayoutpanel的autosize设置为true,autosizemode=GrowAndShrink
现象如下图:
按钮代码如下:没其他代码了。就是测试这个用的
private void button1_Click(object sender, EventArgs e)
{
this.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
//this.tableLayoutPanel1.RowCount++;
Label pLabel = new Label();
pLabel.AutoSize = true;
pLabel.Name = "Label_abc" + _iDown;
pLabel.Text = "343" + _iDown;
pLabel.BorderStyle = BorderStyle.FixedSingle;
this.tableLayoutPanel1.Controls.Add(pLabel);
_iDown = 10 * _iDown;
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
严重搞不懂。。。。求解。。。。
补充:.NET技术 , C#