Good day.
I am working on custom control (really it's Panel with gadgets) that contains some number of another controls. In this case, there are instances of MyEmbeddedControl : UserControl with few panels, buttons, labels and my methods. The behaviour of controls does not matter, point is they have certain locations within custom control. Problem is that CPU load increases up to 99% and crazy lags during scrolling my control:
Normal state
During scrolling
I tried set DoubleBuffered to true. There are many user controls, but showing area is small. I do not understand why paint is so hard. May be I am wrong and I'd better do not use many controls inside my custom control? What are the best practices?