CMFCColorButton will be displayed without style/theme when used in dialog based application - by Bordon

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 740600 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 5/4/2012 9:43:51 AM
Access Restriction Public


The CMFCColorButton will not displayed correctly if this button is placed on a CDialog if the application is dialog based. 
The problem does not occur if the application is i.e. a SDI Doc/View application. In a SDI Doc/View application it is possible to place a CMFCColorDialog on i.e. the AboutDlg and it will displayed correctly.

Therefore I think there is a bug in the CMFCColorButton class.

The same problem exist also with Visual Studio 2008. It is not a Visual Studio 2010 problem only.

I guess the problem is the CMFCVisualManager that is not set up correctly. My investigation in the CMFCColorButton class made me believe this, since the CMFCVisualManager did not paint the control parts.
Sign in to post a comment.
Posted by Microsoft on 5/15/2012 at 10:52 AM

Thanks for the report and the additional information. This issue has been fixed in the MFC application wizard for the next major release of Visual Studio.

To fix this issue in an existing dialog-based application, you just need to add the following line of code to your application InitInstance method (before the dialog is invoked):


Pat Brenner
Visual C++ Libraries Development
Posted by Microsoft on 5/10/2012 at 7:16 AM
Thanks for your update. We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Bordon on 5/7/2012 at 5:32 AM
Hint: I made this screenshots at a XP test machine since the problem is in XP, Vista and 7 with active styles.

Description of Picture "ColorBtnSDIDocview.PNG":
I created an SDI Doc View project in VS2010 with a CFormview derived view. I did not added any code in the project. I placed ony a CMFCColorButton on the formView resource and also on the about dialog resource. You see the CMFCColorButton control will be displayed with styles as expected.

Description of Picture "ColorBtnDlg.PNG":
I created a dialog based application. I did not added any code to the project. I placed only a CMFCColorButton control on the dialog resource and also a CCombobox control, to show the difference. I'd also expect the CMFCColorButton control on a dialog based application is displayed with styles, but is it displayed "classic".

I explained the important stuff on the pictures I hope, and you understand my issue now?

Posted by MS-Moderator10 [Feedback Moderator] on 5/7/2012 at 3:24 AM
Thanks for your feedback. Could you please provide some screenshots to help us better understand this scenario?

Please submit this information to us within 4 business days. We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by MS-Moderator01 on 5/4/2012 at 11:42 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(