Toolbar flat style and double buffering

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
 
B

Bob Powell [MVP]

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
 
B

Bob Powell [MVP]

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top