最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

visual c++ - How to change the colours of a CMFCPropertySheetTabCtrl inside a CMFCPropertySheet - Stack Overflow

programmeradmin2浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论