我现在想改变窗体中某些字的颜色,以显示出不同。但不知从何下手,
请指教!

解决方案 »

  1.   

    在ON_WM_CTLCOLOR_REFLECT()消息中处理
      

  2.   

    我有个Clabel类
    这个类你在网上也可以找到,直接设置RGB就可以了,大小、字体都可以设置
      

  3.   

    HBRUSH CStaticDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
    {
    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

    // TODO: Change any attributes of the DC here
        if (IDC_TXT == ::GetWindowLong( pWnd->GetSafeHwnd(), GWL_ID) )
        {
    pDC->SetBkColor(RGB(0,0,255));
    pDC->SetTextColor(RGB(255,255,225));
        }
    // TODO: Return a different brush if the default is not desired
    return hbr;
    }