Got a TableLayoutPanel in my winform, to increase loading speed. I tried suspending it's layout, adding the rows and resume Layout.
Sadly if I suspend until all rows are added, I get a horizontal scroll bar that does not appear if I resume Layout inbefore adding or suspend after adding each row again.

Msdn states "Add method reapplies the table layout to all the controls":
That's what I have to reproduce by my own code after all rows are added. However adding another row in the end does not produce the layout not suspending at all does.
I tried:
- replace the first column's content with
new Control()just to test if the content was too large. - change the contents size -> led to smaller content, more whitespace and same problem
- change the tableLayoutPanel's size -> led to a smaller control with still the same problem
- change the first column's size (as the later two ones have absolute values) from 100% to a lower percent value, autosize and a similar absolute value -> led to the last column begin oversized, still visible scrollbar
PerformLayout()after rows are addedRefresh()after rows are addedResumeLayout(true)to force pending layout requests/changes (Should absolutely give me the layout I want and get without suspending, maybe buggy or something is overwritten?)Update()after rows are added
tl;dr add rows, lag, no scrollbar vs suspend, add rows, horizontal scrollbar
why and how not to?
Found out that without all the suspending and resuming I experience the same problem if I add EXACTLY 5 rows: 4 work fine as no scrollbar is needed, 6 remove the horizontal scrollbar, 5 is buggy. So the problem goes deeper than layout suspending. There is definitely something wrong with adding a specifing amount of rows overall. -> outsourced to new question (required for this one) -> solved outsourced question,
paused until I stumble upon problems with Suspending again
if(i==6){ tableLayoutPanel1.ResumeLayout(); } if(i==7){ tableLayoutPanel1.SuspendLayout(); }and resuming after all rows have been added again. Sadly it's still the same, don't ask me why, it seems to be just a few pixel off. However if I for example change the code above to wait tili==15before suspending again, it works. There seem to be very little changes with every row added so suspending after the sixth only fails by some pixel, the more rows are added without suspending the more pixel get removed? - user8098743