본문 바로가기

[Proramming]/VC++

[VC++]STATIC, EDIT 컨트롤 글자 색상 변경하기

[VC++]에디트컨트롤 색상 변경하기
HBRUSH CTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
 HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
 
 // TODO: Change any attributes of the DC here
 if(pWnd->GetDlgCtrlID() == IDC_STATIC_INFO)
 {
  pDC->SetTextColor(RGB(255, 0, 0));
  //pDC->SetBkColor(RGB(0, 255, 0));

 }

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


반응형