日期:2014-05-18  浏览次数:20816 次

TableLayoutPanel 控件 怎样创建新的一行 代码实现
TableLayoutPanel 控件 怎样创建新的一行 代码实现

------解决方案--------------------
如下试试看:
C# code
            this.tableLayoutPanel1.RowCount++;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, this.tableLayoutPanel1.Height/this.tableLayoutPanel1.RowCount));
            Button btn = new Button();
            btn.Visible = true;
            this.tableLayoutPanel1.Controls.Add(btn, 0, this.tableLayoutPanel1.RowCount - 1);