CSharp Resize flicker and flashing of WebBrowser TreeView controls

  • Thread starter Thread starter Ian Stiles
  • Start date Start date
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.
 
Mine don't flicker at all. Are you familiar with BeginUpdate and EndUpdate
in .NET?

Because we've had reports of severe flickering from 2 people now, I'm just
wondering if there's a buggy video driver out there. Could you describe
your system?
 
I have tried this on three completely different machines running Windows
XP.

The BeginUpdate and EndUpdate are only useful if you are adding or
removing items to TreeView. There are no such functions on the
WebBrowser control.

A. Does your program fill dock the controls?
B. Do you have "Show window contents while dragging" turned on?
(Right-click desktop, Appearance, Effects)
C. Do you see any artifacts when dragging the window borders?

If I turn this off I don't have the flicker, but many users do turn it
on and it makes your app look like a VB hack app. Remember, Delphi
doesn't have this problem.

Thanks.
 
I have tried this on three completely different machines running Windows
XP.

The BeginUpdate and EndUpdate are only useful if you are adding or
removing items to TreeView. There are no such functions on the
WebBrowser control.

A. Does your program fill dock the controls?
B. Do you have "Show window contents while dragging" turned on?
(Right-click desktop, Appearance, Effects)
C. Do you see any artifacts when dragging the window borders?

If I turn this off I don't have the flicker, but many users do turn it
on and it makes your app look like a VB hack app. Remember, Delphi
doesn't have this problem.

Thanks.
 
I have "Show window contents while dragging" turned on and I can't reproduce
the problem.

Can someone post, on a web site, a complete C# program that demonstrates the
problem?

I still think it is video driver bugs -- perhaps .NET is calling the video
driver in a different way than Delphi, and thus exposing a problem with a
few video drivers.

Ian Stiles said:
I have tried this on three completely different machines running Windows
XP.

The BeginUpdate and EndUpdate are only useful if you are adding or
removing items to TreeView. There are no such functions on the
WebBrowser control.

A. Does your program fill dock the controls?
B. Do you have "Show window contents while dragging" turned on?
(Right-click desktop, Appearance, Effects)
C. Do you see any artifacts when dragging the window borders?

If I turn this off I don't have the flicker, but many users do turn it
on and it makes your app look like a VB hack app. Remember, Delphi
doesn't have this problem.

Thanks.



"Michael A. Covington" <[email protected]>
 
Michael said:
I have "Show window contents while dragging" turned on and I can't reproduce
the problem.

Can someone post, on a web site, a complete C# program that demonstrates the
problem?

I still think it is video driver bugs -- perhaps .NET is calling the video
driver in a different way than Delphi, and thus exposing a problem with a
few video drivers.

Hmm... I'm the one having the trouble with flickering when adding items
to list boxes/views, but I can't reproduce any flicker at all with a
tree view that resizes with the form.

Weird...
 
Back
Top