tableLayoutPanel2.GrowStyle = TableLayoutPanelGrowStyle.AddRows; tableLayoutPanel2.AutoSize = true; int InsertRowNum = tableLayoutPanel2.RowCount; int InsertColumnNum = tableLayoutPanel2.ColumnCount; tableLayoutPanel2.AutoScroll = true; tableLayoutPanel2.Visible = true; RowStyle newRowStyle = new RowStyle(); newRowStyle.SizeType = SizeType.Absolute; newRowStyle.Height = 30; tableLayoutPanel2.RowStyles.Insert(InsertRowNum, newRowStyle); tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(SizeType.Absolute, 30)); //Add controls to the new row tableLayoutPanel2.Controls.Add(textBox1, InsertRowNum + 1, 0); tableLayoutPanel2.Controls.Add(textBox1, InsertRowNum, 1); tableLayoutPanel2.Controls.Add(comboBox1, InsertRowNum, 2); tableLayoutPanel2.Controls.Add(comboBox1, InsertRowNum, 3); for (int row = tableLayoutPanel2.RowCount; row <= tableLayoutPanel2.RowCount; row++) { for (int column = 0; column < tableLayoutPanel2.ColumnCount - 2; column++) { TextBox textBox = new TextBox(); textBox.Text = string.Format("", column, row); tableLayoutPanel2.Controls.Add(textBox3, 5, 0); } } //tableLayoutPanel2.TabIndex++; tableLayoutPanel2.Visible = true; }
tableLayoutPanel2.RowCount += 1;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)