Just in case, make sure that UserPaint and AllPaintingInWmPaint is true. DoubleBuffering requires these bits to be set.
You can attempt to cut down on the flicker and paint time by reducing the number of controls that you are using. You mentioned that
you are using 3 labels and 2 picture boxes. These can easily be represented through GDI without the use of a control. Less
messages in the message loop = faster response time. If you need hit detection for mouse events or other user-interaction with
these controls you'd have to implement that manually via the events of the container control, of course. Also, you'll lose
Form-based featuers that Controls provide such as docking, anchoring, tabbing, amoung others. The 2 panels can also be drawing (the
gradient) without the panels, but you'll lose Control containment that the Panel provides.
If you can reduce the number of controls you are using you will most surely notice a difference.
--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"conset23" <a@yahoo.com> wrote in message news:el*************@TK2MSFTNGP12.phx.gbl...
Hello.
I'm working with WinForm. It has 30 same user control, each with 4 buttons, 3 labels, 3 textboxes, 2 picture boxes and uses
override onPaint to draw gradient rectangle. Main form also has 2 panels with same gradient.
I'm trying to reduce drawing speed on form activation. But at the moment it is too noticeable for each user control to be drawn.
Tried to use double buffering on main form and on each user control, looks almost the same.
Any help appreciated.