I created a game which consist of a 4x4 grid. When a player wins, I'd like to make the game harder by expanding the grid to 10x10.
I've made the form bigger by adding this line:
this.Size = new Size(1375, 1375);
The tableLayoutPanel resizes itself because its Dock property is set to fill.
Then I changed the amount of rows and columns to 10:
this.tableLayoutPanel1.RowCount = 10;
this.tableLayoutPanel1.ColumnCount = 10;
I want each cell to take up 10% of the space, so I tried:
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F));
but it doesn't work: the columns and rows that were there before keep their size, one new row and one new column takes up the rest of the space, and the remaining ones don't take any space at all.
So how can I reset the size of the previous cells and make each one take up 10% of the space?