468,514 Members | 1,307 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

CSharp Resize flicker and flashing of WebBrowser TreeView controls

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.
Nov 15 '05 #1
5 6339
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?

"Ian Stiles" <is*****@xmission.com> wrote in message
news:2e**************************@posting.google.c om...
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.

Nov 15 '05 #2

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.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3
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" <lo**@www.covingtoninnovations.com.for.address> wrote in message news:<OB**************@TK2MSFTNGP10.phx.gbl>...
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?

"Ian Stiles" <is*****@xmission.com> wrote in message
news:2e**************************@posting.google.c om...
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.

Nov 15 '05 #4
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" <is*****@xmission.com> wrote in message
news:2e**************************@posting.google.c om...
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" <lo**@www.covingtoninnovations.com.for.address>

wrote in message news:<OB**************@TK2MSFTNGP10.phx.gbl>...
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?

"Ian Stiles" <is*****@xmission.com> wrote in message
news:2e**************************@posting.google.c om...
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.

Nov 15 '05 #5
Michael A. Covington wrote:
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...
Nov 15 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Ian Stiles | last post: by
1 post views Thread by Vili | last post: by
1 post views Thread by Jon Turner | last post: by
8 posts views Thread by nirdeshonline | last post: by
4 posts views Thread by Frank Rizzo | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.