Hi I\'ve a tablelayoutpanel and I\'m binding controls to it dynamically. When the item count exceeds the height of panel obviously vertical scroll bar appearing there is no
This worked perfectly in .NET 3.5 where the other solutions did not give me exactly what I wanted:
if (this.TableLayoutPanel1.HorizontalScroll.Visible)
{
int newWid = this.TableLayoutPanel1.Width -
(2 * SystemInformation.VerticalScrollBarWidth);
//this.TableLayoutPanel1.Padding = new Padding(0, 0, newWid, 0);
foreach (Control ctl in this.TableLayoutPanel1.Controls)
{
ctl.Width = newWid;
}
}