Reputation: 89
I'm create group box run time in my application, shows caption in blue color in Windows xp and black in windows 7. How to change default caption color of group box in MFC programmatically? so that it can be shown in black color in both Windows XP and Windows 7.
Ex: ::CreateWindow( _T("Button"),_T("Fix Now"), WS_CHILD|WS_VISIBLE|BS_GROUPBOX , XPOSITION, YPOSITION, TOP_ALERTGROUP_WIDTH, 100, //Width, Height m_hWnd , 0 , GetModuleHandle(0), 0 );
How to assign default color as "Black"..
Upvotes: 0
Views: 2708
Reputation: 10411
The colour of the group box is controlled by XP Themes. You can disable the theme for controls by calling this function (you need to pass HWND of your group box):
::SetWindowTheme(hwnd_GroupBox, _T(""), _T(""));
Upvotes: 1