Re: Double Buffering and Initial Paint

From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 04/16/04


Date: Fri, 16 Apr 2004 23:04:25 +0200

AllPaintingInWMPaint prevents the OnEraseBackground event from firing so you
are responsible for clearing the control's surface.
Use e.Graphics.Clear(<somecolour>) in the OnPaint handler.

-- 
Bob Powell [MVP]
Visual C#, System.Drawing
All you ever wanted to know about ListView custom drawing is in Well Formed.
http://www.bobpowell.net/currentissue.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
Read my Blog at http://bobpowelldotnet.blogspot.com
"msnews.microsoft.com" <bkotch@liquidnet.com> wrote in message
news:e9Chcm%23IEHA.3712@TK2MSFTNGP09.phx.gbl...
> when I turn on double buffering ... I get the undesirable side effect that
> the control which is being double buffered momentarily has the same
> background as whatever the window popped up on top of. So for example, if
> the background is the desktop, the background of the control will
> momentarily is blue. (This is especially a problem in my app, b/c not all
> controls have double buffering turned on, so some come up white, and
others
> blue, blah!)
>
> After much experimenation ... this seems to be directly related to the
flag
>
> this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
> When this is set to false, flickering once again occurs, but the
background
> doesn't exhibit this undesirable initial transparency effect.
>
> So the question is ... is there a way NOT to have this background bleed
into
> my app, but STILL not have any flicker.
>
>
>
>


Relevant Pages

  • Double Buffering and Initial Paint
    ... when I turn on double buffering ... ... the control which is being double buffered momentarily has the same ... When this is set to false, flickering once again occurs, but the background ... my app, but STILL not have any flicker. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Scrolling text that doesnt flicker
    ... double buffering is an option to reduce flickering (the ... from Control you can use the following code to ... Override OnPain and OnPaintBackground ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Opinion wanted
    ... the details including the nature of my own app (which you mischaraterized ... correct the current control (provided that control is invalid but invalid ... causes you to validate controls that have already been ... largely discreditted for good reason and has very little use these days. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Honestly Curious
    ... Mac apps do not need this. ... you don't have to run an app at all. ... You don't have to look for the right app to uninstall, ... full control over what is being removed from your HD. ...
    (comp.sys.mac.advocacy)
  • Re: Visual Basic for Autorun?
    ... If changes are required they can't be specific to one app. ... Obviously this doesn't apply to all usercontrols and should ... everything is in the one language. ... >I've done it fairly extensively and it works quite well as long as you keep good control over it. ...
    (microsoft.public.vb.general.discussion)