在OnInitDialog()函数中CEdit::EnableWidow(False)
或者在CEdit框的Properties中选上Disable以后
在对话框的
HBRUSH CNetChangeMsgDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// TODO: Change any attributes of the DC here
if( nCtlColor == CTLCOLOR_EDIT )
{
//pDC->SetBkColor(RGB(255,255,255));
pDC->SetBkColor(RGB(255,0,0));
pDC->SetTextColor(RGB(0,0,0));
HBRUSH w_hbr= ::CreateSolidBrush(RGB(255,255,255));
return w_hbr;
}
// TODO: Return a different brush if the default is not desired
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
return hbr;
}
设置CEdit框背景色失败,一直是那种灰色的背景。
应该怎么做?
是不是在这种情况下就不能改变背景色了?
谢谢
或者在CEdit框的Properties中选上Disable以后
在对话框的
HBRUSH CNetChangeMsgDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// TODO: Change any attributes of the DC here
if( nCtlColor == CTLCOLOR_EDIT )
{
//pDC->SetBkColor(RGB(255,255,255));
pDC->SetBkColor(RGB(255,0,0));
pDC->SetTextColor(RGB(0,0,0));
HBRUSH w_hbr= ::CreateSolidBrush(RGB(255,255,255));
return w_hbr;
}
// TODO: Return a different brush if the default is not desired
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
return hbr;
}
设置CEdit框背景色失败,一直是那种灰色的背景。
应该怎么做?
是不是在这种情况下就不能改变背景色了?
谢谢
解决方案 »
- 高手请进:virtual listview 添加100万条数据后 滚动条移动时总闪烁
- VC加入.c文件
- fwprintf的问题
- 各位帮忙看一下,我添加的菜单但是自己却不能控制它,怎么回事?
- 用CLASSWIZARD怎样建立一个基类是COBJECT的派生类?
- 请教使用CFtpConnection上传文件时,想显示上传进度怎么做??
- 使用CreateDIBSection显示bmp文件
- 你做过邮件系统吗(高分相送,来者有分)
- 紧急!如何在vc里编写用于vb的中间件或连接库?
- 左(TreeView)右(ListView)视图的问题
- 當我的程序要相當一部分時間才能執行完﹐這個時候程序"假死"﹐如何解決?
- “纸上编程"的软件开发技术求教,高分相送!
比如在一个头文件中有
CBrush brush;
在一个CPP中有
brush.CreateSolidBrush(RGB(255,255,255))
然后再有你的代码if(nCrlColor == CTLCOLOR_EIDT)
{
pDC->SetBkColor(...)
pDC->SetTextColor(...)
hbr = brush;
return hbr;
}
{
// TODO: Change any attributes of the DC here
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); if( nCtlColor == CTLCOLOR_EDIT )
{
//pDC->SetBkColor(RGB(255,255,255));
pDC->SetBkColor(RGB(255,0,0));
pDC->SetTextColor(RGB(0,0,0));
HBRUSH w_hbr= ::CreateSolidBrush(RGB(255,255,255));
return w_hbr;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}