Toolbar flat style and double buffering

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi,

The application I'm writing requires double buffering it
also requires a toolbar with its appearance set to flat.
However, this causes a problem because when you set the
following control styles:

SetStyle(ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint,true);

I've looked into this and It think its because of the
WM_ERASEBKG not being called, has anyone got a fix for
this, I don't know how to manually send this message and
at what time?

John
 
Setting the UserPaint style suppresses the WM_ERASEBKGND message and you are
supposed to call the OnPaintBackground explicitly in the drawing handler if
you still need it's default functionality.

--
Bob Powell [MVP]
C#, System.Drawing

The October edition of Well Formed is now available.
Find out how to use DirectX in a Windows Forms control
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Blog http://bobpowelldotnet.blogspot.com
 
Back
Top