I derived CMFCPropertySheet
class from and overrode the OnInitDialog
function:
BOOL CDarkModeMFCPropertySheet::OnInitDialog()
{
BOOL bResult = CMFCPropertySheet::OnInitDialog();
if (IsUsingDarkMode())
{
DarkModeTools::EnableDarkModeForDialog(this);
// Customize tab colors for dark mode
m_wndTab.SetActiveTabColor(RGB(0, 120, 212)); // Active tab background (blue)
m_wndTab.SetTabBkColor(RGB(32, 32, 32)); // Inactive tab background (dark gray)
m_wndTab.SetTabTextColor(RGB(200, 200, 200)); // Inactive tab text (light gray)
m_wndTab.SetActiveTabTextColor(RGB(255, 255, 255)); // Active tab text (white)
// m_wndTab.SetTabBorderColor(RGB(64, 64, 64)); // Tab border (darker gray)
}
return bResult;
}
I have examined the MFC sources and the variable m_wndTab
is defined as:
CMFCPropertySheetTabCtrl m_wndTab;
The CMFCPropertySheetTabCtrl
has all the functions I am trying to use and from the documentation it implies I should be able to colour the tab control. But alas, it is not working. Why?