首页 > 解决方案 > 如何为我的 MFC colorbutton 控件设置默认颜色?

问题描述

我想将粉红色作为默认颜色添加到我的 MFC 颜色按钮而不是黑色。

void TabOne::OnBnClickedColor()
{
    // TODO: Add your control notification handler code here
    CMFCColorButton* thisbutton = (CMFCColorButton*)GetDlgItem(Color);
    COLORREF ref = RGB(255, 0, 255);
    thisbutton->SetColor(ref);
    thisbutton->UpdateWindow();
}

它不会改变颜色。

标签: visual-c++mfc

解决方案


推荐阅读