tags:

views:

47

answers:

2

I have a C# Forms program with about 200 controls total. Some are within user controls which I have added to the Form. When I ran my program on my home machine, a Dual core AMD X64, 2.0Ghz with an ATI X1600 card, the program runs fine. It's fast and redraw is not a problem.

When I put this program onto my desktop, a quad core Intel 2.4Ghz, 4GB RAM, and a NVidia Gefore 8800GT, it slowed to a crawl when redrawing. Could this be a driver issue?

I have Double buffering enabled for all of my user controls and forms. No help there.

I have read this thread, but my situation is not the same: http://stackoverflow.com/questions/587856/super-slow-c-custom-control

A: 

the thing is ".SuspendLayout();" is not really stop drawing. i can't remember the statement but i believe u can get it on google. and try to using .AddRange might help.

888
A: 

It's important to note that drawing controls is like painting on a 2D surface, overlapping as required. If the control does not understand things like rectangle clipping, it could be drawing a portion of the control that is not visible (especially controls that are hidden in another container, like a TabPage), wasting valuable CPU cycles. Additionally, controls that have their BackColor as transparent will attempt to mimic transparency by adopting the BackColor of its parent control. Since all of this occurs on GDI+, which is not hardware accelerated, having many controls that exhibit this behavior will exacerbate the slow down.

Michael