在一对话框控件上有一静态文本框控件, 如何使静太文本框中的文字有颜色?
解决方案 »
- VC8,Socket的recv函数VISTA下遇到断网怎么不返回啊,XP都能返回
- CoCreateInstance 的问题
- 我建的一MDI工程,在其一菜单点击弹出一CDialog,可是当关闭它再打开它,点击程序最小化再恢复时,发现Dialog不见了。怎么回事啊?
- 请教ftp客户端数据上传问题:在通过新建立的数据连接把文件数据发送到接收方后,是否需要完成标志呢
- 关于MFC前途的疑惑。
- 串里字符的全角与半角的判断
- 请问如下的ADO访问数据库中的数据,为什么有错?
- 我如何设计按扭代码?
- 求助啊,如何添加暂停/继续,我是小白
- CTreeCtrl控件相关
- 急求如下例子:当文本框输入内容时弹出一个窗口,就象一个跟踪输入内容的一样,比如你输入a,然后弹出所有a字母开头的内容
- 向modal窗体发送自定义消息异常
{
HDC hDC=(HDC)wParam;
::SetTextColor(hDC,RGB(245,0,9));
::SetBkMode(hDC,TRANSPARENT);
return NULL;
}
// with the ID of IDC_MYSTATIC. The code assumes that the CMyDialog
// class has an initialized and created CBrush member named m_brush.
// The control will be painted with red text and a background
// color of m_brush.HBRUSH CZilchDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
// Call the base class implementation first! Otherwise, it may
// undo what we're trying to accomplish here.
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); // Are we painting the IDC_MYSTATIC control? We can use
// CWnd::GetDlgCtrlID() to perform the most efficient test.
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{
// Set the text color to red
pDC->SetTextColor(RGB(255, 0, 0)); // Set the background mode for text to transparent
// so background will show thru.
pDC->SetBkMode(TRANSPARENT); // Return handle to our CBrush object
hbr = m_brush;
} return hbr;
}