Microsoft KB Archive/944311

= You cannot change the color of a check box or a group box if you enable a Windows XP theme in a Visual Studio .NET 2003 project =

Article ID: 944311

Article Last Modified on 12/6/2007

-

APPLIES TO


 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Academic Edition

-



SYMPTOMS
Consider the following scenario.
 * In a Microsoft Visual Studio .NET 2003 project, You use the standard win32 API to add a check box or a group box.
 * You add a manifest file to the project to enable a Windows XP theme.
 * Then, you try to call functions to change the font color of the check box or the group box.

In this scenario, the font color of the check box or the group box is not changed.



CAUSE
This behavior occurs because you add a manifest file to load the 6.0 version of the Common Controls Library (Comctl32.dll). When you do this, you obtain control functionality that overrides the ability to customize colors at the application level.



WORKAROUND
To work around this problem, use one of the following methods:
 * Custom draw a control. To do this, use Windows XP Theme Manager to draw the check box or the group box
 * Remove the text of the group box or the check box. Instead, use a static control. Then, handle the WM_CTLCOLORSTATIC message, and call the SetTextColor function in the project.



STATUS
This behavior is by design.

Additional query words: Win32 API XP Theme Font Color

Keywords: kbtshoot kbprb KB944311

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.