Multiple nested FlowLayoutPanel causes very poor performance

A

adimiller

Hi.

I have written a UserControl which creates a simple layout of some
control from an internal data structure that we have. This UserControl
does extensive use of FlowLayoutPanels (plurarl). In addition, I am
using this UserControl INSIDE an outter FlowLayoutPanel to display a
list of such UserControl (around 10-15).

If you ever played around with FlowLayoutPanels, you would guess by
now that performance of this arrangement is terrible. The time it
takes the entire form to resize while having 10-15 of these guys on
the screen is almost the time it takes you to read this last
paragraph... ;)

I did alot of reading about SuspendLayout and ResumeLayout, only to
discover that these method are not hierarchical (i.e. calling
SuspendLayout on panel1 only suspends panel1's layout operation, and
not all the inner panels).

I'm looking for the best way to dramatically increase the visual
performance of my constellation. I have tried nesting a whole bunch of
Suspend/ResumeLayout pairs, but since they are not hierarchical,
everytime I call Resume on one level panel, it repaints regardless of
the parent, so performance suffers. I tried using ResumeLayout(false)
all the way, but that kind of beats the purpose. I tried not using
SizeChanged event, but rather find an alternative - but couldn't.

Does anyone has any experience in this area that can lend a hand?

Btw, I read some good advice in the following articles, but nothing
that actually helped me: http://blogs.msdn.com/jfoscoding/archive/2005/03/04/385625.aspx

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top