I have a TableLayoutPanel with k columns and k rows.

 table = new TableLayoutPanel { Dock = DockStyle.Fill }; table.RowStyles.Clear(); table.ColumnStyles.Clear(); for (var k = 0; k < Order; k++) { table.RowStyles.Add(new RowStyle(SizeType.Percent, 100 / Order)); table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100 / Order)); } 

Then I insert a Label with the text into each row and column:

 for (var i = 0; i < Order; i++) for (var j = 0; j < Order; j++) { table.Controls.Add(new Label { Dock = DockStyle.Fill, TextAlign = ContentAlignment.MiddleCenter, Font = new Font("Webdings", 72, FontStyle.Regular), Text = "" }, i, j); } 

When the window is resized when k = 4 form is even less well and quickly drawn, but when k = 8 form behaves strangely and when you expand the window on the whole screen, it takes 2-3 seconds and when it looks, it looks strange. What's the matter?

How the form looks when drawing

  • Strangely, the screenshot is not visible, but on the form itself, the central cells were not drawn and the "pieces" as in the upper left corner are larger. And of course in the question design lines of code, like "text color", I dropped. - Arzybek
  • I figured out, the whole thing was in the outline of the cells of the tables, they were crookedly drawn - Arzybek

0