Hi,
I searched around in MSDN for a few days, and I finally came up with the following code to set the text color of a radio button in a dialog box. Unfortunately, it doesn't work. I added the OnCtlColor() handler to my Dialog box class(CCodeProject_Dialog2Dlg). My dialog box has radio buttons, check boxes, combo boxes, list boxes and I tried substituting several of their ID's in the code, and none of the text changed color. Can anyone tell me how do change the text color on a button?
Code:
HBRUSH CCodeProject_Dialog2Dlg::OnCtlColor(CDC *pDC, CWnd *pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(pWnd->GetDlgCtrlID() == IDC_WIN98)
{
pDC->SetTextColor(RGB(255,0,0));
pDC->SetBkMode(TRANSPARENT);
}
return hbr;
}