Hi everyone,
how to change the button color with help onctlcolor().
I will develop code it is not working could pls give suggestion
CBrush m_brush; //dlg.h
m_brush.createsolidbrush(RGB(255,0,0));//dlg.cpp(oninitdialog())
CTestClass:OnCtlColor(CDC pDC,CWD pWnd,UINT nctlcolor)
{
HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
switch(nCtlColor)
{
case IDC_BUTTON1: pDC->setBkColor((RGB(255,0,0));
hbr = m_brush;
}
return m_brush;
}