-
Owner-draw button
I've just started out with owner-drawn buttons. When I create a owner-drawn button the button rectangle gets painted with the same color as a dialog's background.
I've successfully painted over this handling the WM_DRAWITEM message.
I'm trying to figure out where this dialog-color painting is coming from (e.g. during what message is the window painted) since I want to make use of transparency effects on my button and thus need the dialog-colored block removed.
For what is is worth, I've noticed that the normal push button also includes the dialog-colored "background" at its outer edges (please see attached image).
I know how to remove the dialog-colored background from a static image by handling WM_CTLCOLORSTATIC, but I'm a bit lost with this button.
Any ideas please?
-
Re: Owner-draw button
There are dozens of examples ou there of owner-drawn buttons and transparent background buttons. Look at http://www.codeguru.com/cpp/controls/buttonctrl/ for some solutions
Mike
-
Re: Owner-draw button
Thanks for the link. I've looked at the examples but most of them use MFC which I know nothing about and find it difficult to figure out exactly whats going on.
I've figured out that I need to handle the WM_CTLCOLORBTN message. Everything is not perfect yet, but it works better.
-
Re: Owner-draw button
See rather the dozens of MS samples in C in MSDN, PSDK, KB, etc