设置控件的背景颜色。。出错了
分别设置各控件的背景颜色,怎么会出错呢??错误提示为errorC2446:'==':noconversionfrom'constint'to'int(__thiscall...
分别设置各控件的背景颜色,怎么会出错呢??错误提示为
error C2446: '==' : no conversion from 'const int' to 'int (__thiscall CWnd::*)(void) const'
There are no conversions from integral values to pointer-to-member values
以下为代码
HBRUSH CDerrDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(pWnd->GetDlgCtrlID==IDC_RED)
{
pDC->SetBkMode(TRANSPARENT);//
return m_red;
}
if(pWnd->GetDlgCtrlID==IDC_GREEN)
{
pDC->SetBkMode(TRANSPARENT);//
return m_green;
}
if(pWnd->GetDlgCtrlID==IDC_BLUE)
{
pDC->SetBkMode(TRANSPARENT);//
return m_blue;
}
// TODO: Return a different brush if the default is not desired
return hbr;
} 展开
error C2446: '==' : no conversion from 'const int' to 'int (__thiscall CWnd::*)(void) const'
There are no conversions from integral values to pointer-to-member values
以下为代码
HBRUSH CDerrDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(pWnd->GetDlgCtrlID==IDC_RED)
{
pDC->SetBkMode(TRANSPARENT);//
return m_red;
}
if(pWnd->GetDlgCtrlID==IDC_GREEN)
{
pDC->SetBkMode(TRANSPARENT);//
return m_green;
}
if(pWnd->GetDlgCtrlID==IDC_BLUE)
{
pDC->SetBkMode(TRANSPARENT);//
return m_blue;
}
// TODO: Return a different brush if the default is not desired
return hbr;
} 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询