At runtime, whenever I remove a row from a TableLayoutPanel, the actual size of the last row is increasing.
The table is intialized as follows:
_table.AutoScroll = true;
_table.AutoSize = false;
_table.RowCount = 10;
for (int j = 0; j < 10; j ++)
{
_table.RowStyles.Add(
new RowStyle(System.Windows.Forms.SizeType.Absolute, DEFAULT_HEIGHT));
}
The remove code is as follows:
void RemoveLastRow()
{
_table.RowCount = _table.RowCount -1
_table.RowStyles.RemoveAt(_table.RowStyles.Count - 1);
}
After I do the remove, the new last row now has a height that is double what it used to be. The RowStyle for this row still reports DEFAULT_HEIGHT, but the GetRowHeights method reports the new size. The combined heights of all of the rows is greater than the Size (vertical scroll bar is present), so the last row is not increasing to fill out the area of the control.
Any thoughts would be appreciated.
--Craig

removing rows from TableLayoutPanel
Koruyucu
Pauly C
DD_Helmetman