プログラムで tablelayoutpanel を作成したい。私は次のようなコードを持っています:
TableLayoutPanel tlpCurrent = new TableLayoutPanel();
tlpCurrent.RowStyles.Clear();
tlpCurrent.RowCount++;
tlpCurrent.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f));
tlpCurrent.RowCount++;
tlpCurrent.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f));
tlpCurrent.RowCount++;
tlpCurrent.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f));
tlpCurrent.RowCount++;
tlpCurrent.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f));
tlpCurrent.RowCount++;
tlpCurrent.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f));
tlpCurrent.RowCount++;
tlpCurrent.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f));
tlpCurrent.RowCount++;
tlpCurrent.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f));
tlpCurrent.RowCount++;
tlpCurrent.RowStyles.Add(new RowStyle(SizeType.Absolute, 40f));
tlpCurrent.ColumnStyles.Clear();
tlpCurrent.ColumnCount++;
tlpCurrent.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 150f));
for (int i = 0; i < 3; i++)
{
tlpCurrent.ColumnCount++;
tlpCurrent.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 150f));
}
tlpCurrent.Location = new Point(500, 100);
tlpCurrent.Size = new System.Drawing.Size(300, 300);
tlpCurrent.AutoSize = true;
this.Controls.Add(tlpCurrent);
しかし、Windowsフォームでは表示できません。このコードはエラーなしで実行されると確信しています。何か案は?