当我在CEdit控件中选择“只读”属性后,CEdit的背景色为灰色,我想修改
背景色为其他颜色,同时能显示多行文本,应该如何做呢?CEdit* pEdit = static_cast<CEdit*>(GetDlgItem(IDC_FUNCINTRO));
pEdit->SetWindowText(mystring);
背景色为其他颜色,同时能显示多行文本,应该如何做呢?CEdit* pEdit = static_cast<CEdit*>(GetDlgItem(IDC_FUNCINTRO));
pEdit->SetWindowText(mystring);
if(nCtlColor==CTLCOLOR_EDIT)
return CreateSoildBrush(RGB(255,255,255));
在MSDN上也查不到它的具体用法。。
先谢了。。别笑我菜。。^-^
pDC->SetBkMode(RGB(255,0,0)); return HBRUSH(GetStockObject(HOLLOW_BRUSH));
下面是我的代码。HBRUSH CCadBenchView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(nCtlColor==CTLCOLOR_EDIT)
pDC->SetBkMode(RGB(255,255,255));
return HBRUSH(GetStockObject(HOLLOW_BRUSH));// TODO: Return a different brush if the default is not desired/
return hbr;
}
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if(nCtlColor==CTLCOLOR_EDIT)
{
pDC->SetBkMode(RGB(255,255,255));
return HBRUSH(GetStockObject(HOLLOW_BRUSH));
}
// TODO: Return a different brush if the default is not desired/
return hbr;
}
我是想改变CEdit窗口的背景色。谢了。。