I have a fairly complex user drawn control that is double buffered. Works very well, except when another window is moved over it. This results in holes in the control where it has not been refreshed. It is not repainting itself correctly. I've tried all the usual fixes...
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
Doesn't help. As a cludge I have put a Timer control in the window and set it to refresh every 10 milliseconds. This seems extremely cludgy.
If I turn off double buffering the control refreshes correctly, but is otherwise messed up due to flickering.
Edit: there are no child windows in the user control. The entire surface of the user control is drawn in the paint event using graphics methods. Using WS_EX_COMPOSITED has fixed the drag over problem but there is a remaining problem with tooptips leaving a void area when they close. So far the only fix is the refresh timer and I am hoping someone knows more windows magic.