I want to change a CButton background color to AQUA color.
How to do this?
Thank you very much.
Derive class
class CMyButton: public CButton
{
};
and override OnEraseBkgnd(). In that function call CDC:: FillSolidRect()
with the AQUA color . The rect should be the one returned by
GetClientRect().
-- David
When I clicked it, the flat style is different and when I tried TAB order,
it DID NOT accept the focus.
Does your advice also affect like that?
If yes, how to solve this?
Thank you.
Tom
"Landon" <Lan...@discussions.microsoft.com> wrote in message
news:1485AD87-D82E-42C9...@microsoft.com...
Yes; unless the derived class changes it.
> Because I have tried to derive one class but when I tested the TAB order, and clicking
> the button, it BEHAVE different from the NORMAL CButton. When I clicked it, the flat style is different and when I tried
> TAB order, it DID NOT accept the focus.
If you are owner drawing it, then you may have some effect. However
behavior of tab key will not change unless you change it in derived
class. I have used the following with good success:
http://www.codeproject.com/KB/buttons/cbuttonst.aspx
--
Ajay
Once you take over the drawing, you and you alone are responsible for what the button
looks like.
joe
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm