WM_CTLCOLOR事件

HBRUSH CFontDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
    
    // TODO: Change any attributes of the DC here
    if(nCtlColor == CTLCOLOR_EDIT) //判断是否为编辑框控件
        pDC->SetBkColor(m_Color); //设置文本背景颜色
        //pDC->SetTextColor(m_Color); //设置文本前景颜色

    // TODO: Return a different brush if the default is not desired
    return hbr;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
猜你喜欢
  • 2022-12-23
  • 2021-08-25
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案