tags:

views:

40

answers:

1

Stack-O, I have a TableLayoutPanel with 50 rows and 6 columns. That's all well and good, but whenever I move or resize my WinForm, it takes about 15 seconds for the TableLayoutPanel to repaint. How can I speed this up?

A: 

1). Hide the table when resizing.

2). Froze layout processing of the table when resizing.

4). Don't use custom colors, i mean not Color.Control for background of both table and child controls.

5). Don't use the table panel. I am serious -- if you need to maintain order of tens of controls, use your own layout logic; it's not so complicated. It's simple arithmetic and a collection of controls to move, and it's much more efficient.

IMHO.

Dmitry Karpezo
Sorry I forgot to mention that the table hides when it resizes, but after you settle on a size, it has to repaint it in the new size once, and that's what's taking so long. Can I hide it while it... paints? :S I'm confused...
Soo
I had the same problem, I had about 50 controls on the table. I tried making the table transparent and . It's all inefficient. The only effective solution is to get rid off the table control and position child controls manually in OnSize(). In general, get rid off any container you can afford. IMHO.
Dmitry Karpezo
And, you can try for your form:protected override CreateParams CreateParams{ get { CreateParams cp = base.CreateParams; cp.ExStyle |= 0x02000000; return cp; }}But it has side effects, be carefull.
Dmitry Karpezo
it's exstyle WS_EX_COMPOSITED
Dmitry Karpezo