控件颜色一

COLORREF m_crText;

CFont m_font;

m_font.CreatePointFont(150,"华文行楷");//代表15号字体,华文行楷

 

HBRUSH dlg::CtlColor(CDC* pDC, UINT nCtlColor, Cwnd* pWnd) 

   HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);

 if(pWnd->GetDlgCtrlID()== IDC)

 {

 }

  if (CTLCOLOR_STATIC == nCtlColor) 

  { 

    

    pDC->SelectObject(&m_font); 

     pDC->SetTextColor(m_crText); 

     pDC->SetBkColor(NULL_BRUSH); 

     pDC->SetBkMode(TRANSPARENT);

    return (HBRUSH)GetStockObject(NULL_BRUSH);

   } 

        return hbr;

}

posted @ 2014-10-09 14:15  snker_tan  阅读(161)  评论(0编辑  收藏  举报