I want to disable rows autoscaling of TableLayoutPanel so that it would fit, for example, 4 columns on width and 3 rows on height and autoscrolling also would work. What should I change?
Code:
public UserControl()
{
InitializeComponent();
tableLayoutPanel1.ColumnStyles.Clear();
tableLayoutPanel1.RowStyles.Clear();
foreach (Picture picture in Program.gallery)
addImage(picture);
for (int i=0;i<tableLayoutPanel1.ColumnCount;i++)
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f/4));
for (int i = 0; i < 99999; i++)
tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100f/3));
}
TableLayoutPanel has:
AutoScroll=true;
AutoSize=false;
ColumnCount=4;
RowCount=3;
Dock=true;
GrowStyle=AddRows;