S
sdnd2000
Guest
Hi, can we change dialog backgournd color and the text color at the same time? it looks like it returns one brush at a time. I have to return either hbr or br
HBRUSH TopBar::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID()==IDC_STATIC_TEXT)
{
pDC->SetTextColor(RGB(r,g,b));
}
pDC->SetBkColor(RGB(51, 255, 153));
static CBrush br(RGB(51, 255, 153));
return (hbr);
}
Continue reading...
HBRUSH TopBar::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID()==IDC_STATIC_TEXT)
{
pDC->SetTextColor(RGB(r,g,b));
}
pDC->SetBkColor(RGB(51, 255, 153));
static CBrush br(RGB(51, 255, 153));
return (hbr);
}
Continue reading...