views:

654

answers:

1
+5  A: 

The CMFCButton has the BS_OWNERDRAW style set by default - you can remove it in the OnInitDialog() for your dialog:

mfcButton.ModifyStyle(BS_OWNERDRAW, 0, 0);

However, removing the owner draw style results in many of the methods of CMFCButton being rendered useless (e.g. SetTextColor). You can get the button to render using the current windows theme by setting up the visual manager:

CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));

This is done instead of the ModifyStyle above, resulting in buttons that fit the default style but still have the newer rendering features.

Steve Beedie
Thanks, that solved the problem. But, does this mean I won't have access to CMFCButton specific features, like changing text color?
djeidot
Good point - turns out there is another way, answer updated with details.
Steve Beedie
That's it, thanks.
djeidot