Hi,

Thanking you for your concern...

I'm not getting the color text for radio button and check box. Can u check out.
Code:
 
BOOL CEx4Dlg::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CBitmap bmp;
CBitmap* ptrBmpOld;
CDC dcMem;
BITMAP bm;
CRect rect;
int i,j;
int nVer, nHor;
bmp.LoadBitmap(IDB_BITMAP2);
bmp.GetBitmap(&bm);
GetClientRect(rect);
nHor=rect.Width()/bm.bmWidth+1;
nVer=rect.Height()/bm.bmHeight+1;
dcMem.CreateCompatibleDC(pDC);
ptrBmpOld=dcMem.SelectObject(&bmp);
for(i=0;i<nHor;i++)
{
for(j=0;j<nVer;j++)
{
pDC->BitBlt(i*bm.bmWidth,j*bm.bmHeight,bm.bmWidth,bm.bmHeight,&dcMem,0,0,SRCCOPY);
}
}
dcMem.SelectObject(ptrBmpOld);
return TRUE;// CDialog::OnEraseBkgnd(pDC);
}
 
 
 
 
HBRUSH CEx4Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
//HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
HBRUSH brush;
switch(nCtlColor)
{
case CTLCOLOR_BTN:
case CTLCOLOR_STATIC:
{
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(RGB(0,0,255));
brush=(HBRUSH)::GetStockObject(NULL_BRUSH);
break;
}
case CTLCOLOR_EDIT:
{
pDC->SetBkMode(TRANSPARENT);
pDC->SetBkColor(RGB(0,0,0));
pDC->SetTextColor(RGB(0,0,255));

brush=(HBRUSH)::GetStockObject(NULL_BRUSH);
return br1;
break;
}
case CTLCOLOR_LISTBOX:
{
pDC->SetBkMode(TRANSPARENT);
brush=(HBRUSH)::GetStockObject(NULL_BRUSH);
break;
}
case CTLCOLOR_SCROLLBAR:
{
pDC->SetBkMode(TRANSPARENT);
brush=(HBRUSH)::GetStockObject(NULL_BRUSH);
break;
}
default:brush=CDialog::OnCtlColor(pDC,pWnd,nCtlColor);

}
if(pWnd->GetDlgCtrlID()==IDC_CHECK1)
{
pDC->SetTextColor(RGB(0,0,0));
//pDC->SetBkColor(RGB(0,0,0));
pDC->SetBkMode(TRANSPARENT);
//brush=(HBRUSH)::GetStockObject(NULL_BRUSH);
return br1;
}
if(pWnd->GetDlgCtrlID()==IDC_RADIO1)
{
pDC->SetTextColor(RGB(255,0,0));
//pDC->SetBkColor(RGB(255,0,0));
pDC->SetBkMode(TRANSPARENT);
//brush=(HBRUSH)::GetStockObject(NULL_BRUSH);
return br1;
}
// TODO: Return a different brush if the default is not desired
return brush;
}

Last edited by shabbir; 10Mar2009 at 15:13.. Reason: Code blocks