Quote:
Originally Posted by shabbir View Post
I just realized you had the thread in the introduction forum and I moved it to MFC/Win32 forum.

If the event is fired it should and just post the code you are working on and we can look into it.
Here my code is working if i did like this for radio button and check box and static controls. But i need to change the color of the text for check box and radio buttons.

Code:
 
BOOL CEx3Dlg::OnInitDialog()
{
br1.CreateSolidBrush(RGB(100,100,100));
}
 
 
HCURSOR CEx3Dlg::OnQueryDragIcon()
{
return static_cast<HCURSOR>(m_hIcon);
}
 
HBRUSH CEx3Dlg::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_DLG)
{
return br1;
}
else if(pWnd->GetDlgCtrlID()==IDC_CHECK1)
{
//pDC->SetTextColor(RGB(150,150,0));
//pDC->SetBkColor(RGB(100,100,100));
return br1;
}
else if(pWnd->GetDlgCtrlID()==IDC_RADIO1)
{
//pDC->SetTextColor(RGB(150,150,0));
//pDC->SetBkColor(RGB(100,100,100));
return br1;
}
else if(pWnd->GetDlgCtrlID()==IDC_STATIC)
{
pDC->SetTextColor(RGB(100,0,0));
pDC->SetBkColor(RGB(100,100,100));
return br1;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
q
With
warm regards
tgm.arjun

Last edited by shabbir; 9Mar2009 at 10:34.. Reason: Code blocks