Is SuspendLayout/ResumeLayout worthless or am I going about it wrong?

Viewed 11052

I have two tab pages hosting TableLayoutPanels that I dynamically populate with labels and textboxes. The first one gets 96 labels and 96 textboxes, and its flicker is acceptable/tolerable, so I didn't bother to add a SuspendLayout/ResumeLayout pair.

However, the second one gets 96 labels and 288 textboxes, and its painting/flickering is intolerable. IOW, 192 controls seems to be okay, but 384 is decidedly not.

I was calling SuspendLayout prior to creating the controls dynamically, and then ResumeLayout in the finally block, but removed them, and voila! Like the first tabPage/TLP, the flicker is acceptable.

Why does this addition by subtraction work?

2 Answers
Related