in a dialog resource and set the bitmap
in the code with CButton::SetBitmap.
This works fine.
But when I disable the button with CWnd::EnableWindow,
the whole button becomes dark grey. I recall
having seen a disabled button where the
picture just had a "lighter" version
of the original picture when disabling.
What am I doing wrong?
Geoff
unread,
Jan 19, 2015, 1:35:34 PM1/19/15
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
You must provide your own greyed-out version of your button and
respond to the control messages it will receive.
Windows will gray out non-custom buttons for you but when you decide
to customize your buttons you take on the responsibility for providing
all the versions of that button in all the states it may be required
to display.
Joe Newcomer answered this question in 2001 and described some of the
defects of the CButton class. His solution was a smarter CBitmapButton
class you may find helpful.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
>But when I disable the button with CWnd::EnableWindow,
>the whole button becomes dark grey. I recall
>having seen a disabled button where the
>picture just had a "lighter" version
>of the original picture when disabling.
Hi Frank,
If you use an icon (BS_ICON) instead of a bitmap, I think you'll find
the result should be better.