I
Ian Stiles
I have tried everything under the sun to get rid of horrible flashing
and flickering that occurs on a CSharp form when the form hosts a
TreeView or WebBrowser control and then you resize the form.
Here is what I've tried so far:
1. Turning off CS_VREDRAW and CS_HREDRAW in both the parent form and a
subclass of the control via the "override CreateParams" property
(these values were already off).
2. Setting various styles and handling the OnPaintBackground to do
nothing while also filtering WM_ERASEBKGND during the OnNotifyMessage
event. This was done by the following in the form and control
sub-class constructor:
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
// Allows for catching the WM_ERASEBKGND message
SetStyle(ControlStyles.EnableNotifyMessage, true);
3. Setting WS_CLIPCHILDREN in the form's CreateParams (was already
set).
Just for fun I tried Delphi and made a form with both controls and the
resize has no flicker whatsoever so I know this is possible.
Thanks in advance for any help.
and flickering that occurs on a CSharp form when the form hosts a
TreeView or WebBrowser control and then you resize the form.
Here is what I've tried so far:
1. Turning off CS_VREDRAW and CS_HREDRAW in both the parent form and a
subclass of the control via the "override CreateParams" property
(these values were already off).
2. Setting various styles and handling the OnPaintBackground to do
nothing while also filtering WM_ERASEBKGND during the OnNotifyMessage
event. This was done by the following in the form and control
sub-class constructor:
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
// Allows for catching the WM_ERASEBKGND message
SetStyle(ControlStyles.EnableNotifyMessage, true);
3. Setting WS_CLIPCHILDREN in the form's CreateParams (was already
set).
Just for fun I tried Delphi and made a form with both controls and the
resize has no flicker whatsoever so I know this is possible.
Thanks in advance for any help.