I am sure i am doing something wrong here or something i am not suppose to , please help.
my code looks like one below....
// in dialog partdetails.h header file.
bool OnCtlColor(CDC* pDC,CWnd* pWnd, UINT nCtlColor);
// in my dialog partdetails.cpp file
void CPartDetails:

oDataExchange(CDataExchange* pDX )
{
CDialog:

oDataExchange(pDX);
//{{AFX_DATA_MAP(CPartDetails)
DDX_Text(pDX, IDC_PART_CODE, m_PDPartCode);
}
// color function decl.
bool CPartDetails::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
if (nCtlColor == CTLCOLOR_EDIT && pWnd->GetDlgCtrlID()==IDC_PART_CODE)
{ pDC->SetBkColor(RGB(0,0,255));
pDC->SetTextColor(RGB(255,0,0));
}
return true;
}
// original code with switch statment to enable disable buttons.
BOOL CPartDetails::OnInitDialog()
{
CDialog::OnInitDialog();
//background colours decl.
m_redcolor = RGB(255,0,0); //red
m_bluecolor = RGB(0,0,255); //Blue
m_textcolor = RGB(255,255,255); //White
m_bluebrush.CreateSolidBrush(m_bluecolor); //blue background
m_redbrush.CreateSolidBrush(m_redcolor); //red background
switch(m_dlgType)
{
case DLG_DETAILS:
default:
{
// need to fill color to edit box and change font color.
// ERROR does not work, requires parameters
//doing something wrong................
OnCtlColor();
break;
}
}
return TRUE;
}