添加对话框的WM_CTLCOLOR消息响应函数OnCtlColorHBRUSH OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor );nCtlColor 就是标准控件的类型:
CTLCOLOR_BTN Button control
CTLCOLOR_DLG Dialog box
CTLCOLOR_EDIT Edit control
CTLCOLOR_LISTBOX List-box control
CTLCOLOR_MSGBOX Message box
CTLCOLOR_SCROLLBAR Scroll-bar control
CTLCOLOR_STATIC Static control 看看MSDN,有例子
CTLCOLOR_BTN Button control
CTLCOLOR_DLG Dialog box
CTLCOLOR_EDIT Edit control
CTLCOLOR_LISTBOX List-box control
CTLCOLOR_MSGBOX Message box
CTLCOLOR_SCROLLBAR Scroll-bar control
CTLCOLOR_STATIC Static control 看看MSDN,有例子
解决方案 »
- 新建单文档工程,要让CChildView从CListView继承,只能手动修改代码么?
- 菜单栏 命令 不响应
- 电子书的好站点
- 现金求电路图:无线短信终端的电路图
- 请问,vc7.0的界面开发方便性比vc6.0是否有提高,另外,vc7.0比6.0主要强在何处,多谢。
- VC6.0中的编译、连接与运行源程序的各应用程序在安装目录的哪些文件夹下?
- 什么情况下要设置send超时,发送的时候好像不会堵塞的?
- help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!再加100分。。。。。。。
- 树型控件的实现(SDK)
- VC做的客户端如何访问服务器上的数据库
- 关于系统托盘编程的问题
- 输入的智能识别 (200 分,来着也有分)
把//DEL全部去掉就可以了
//DEL void CSmsDlg::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
//DEL {
//DEL
//DEL // 更改界面字体颜色
//DEL // TODO: Add your message handler code here and/or call default
//DEL UINT uStyle = DFCS_BUTTONPUSH;
//DEL
//DEL // This code only works with buttons.
//DEL ASSERT(lpDrawItemStruct->CtlType == ODT_BUTTON);
//DEL // If drawing selected, add the pushed style to DrawFrameControl.
//DEL if (lpDrawItemStruct->itemState & ODS_SELECTED)
//DEL uStyle |= DFCS_PUSHED;
//DEL // Draw the button frame.
//DEL ::DrawFrameControl(lpDrawItemStruct->hDC, &lpDrawItemStruct->rcItem, DFC_BUTTON, uStyle);
//DEL
//DEL // Get the button's text.
//DEL CString strText;
//DEL COLORREF crOldColor;
//DEL switch(nIDCtl)
//DEL {
//DEL /*
//DEL case IDC_SENDMSG:
//DEL {
//DEL m_nSendMsg.GetWindowText(strText);
//DEL // Draw the button text using the text color
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,125,0));
//DEL break;
//DEL }
//DEL case IDC_REINPUT:
//DEL {
//DEL m_nReinput.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,125,0));
//DEL break;
//DEL }
//DEL case IDC_HISTORY:
//DEL {
//DEL m_nHistory.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,125,0));
//DEL break;
//DEL }
//DEL case IDC_UPGRADE:
//DEL {
//DEL m_nUpgrade.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,125,0));
//DEL break;
//DEL }
//DEL case IDC_TIMING:
//DEL {
//DEL m_nTiming.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,125,0));
//DEL break;
//DEL }
//DEL case IDC_QUEUE:
//DEL {
//DEL m_nQueue.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,125,0));
//DEL break;
//DEL }
//DEL case IDC_TELEPHONEBOOK:
//DEL {
//DEL m_nTeleBook.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,125,0));
//DEL break;
//DEL }
//DEL case IDC_CLOSE:
//DEL {
//DEL m_close.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,125,0));
//DEL break;
//DEL }
//DEL case IDC_ABOUT:
//DEL {
//DEL m_nAbout.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,0,125));
//DEL break;
//DEL }*/
//DEL case IDC_LANGUAGE:
//DEL {
//DEL m_btnLanguage.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(125,0,0));
//DEL break;
//DEL }
//DEL case IDC_BROADCAST:
//DEL {
//DEL m_btnBroadcast.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(125,0,0));
//DEL break;
//DEL }
//DEL /*
//DEL case IDC_CHOICE:
//DEL {
//DEL m_nChoice.GetWindowText(strText);
//DEL crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,0,125));
//DEL break;
//DEL }*/
//DEL default:
//DEL break;
//DEL }
//DEL // Draw the button text using the text color
//DEL //COLORREF crOldColor = ::SetTextColor(lpDrawItemStruct->hDC, RGB(0,125,0));
//DEL
//DEL ::DrawText(lpDrawItemStruct->hDC, strText, strText.GetLength(), &lpDrawItemStruct->rcItem, DT_SINGLELINE|DT_VCENTER|DT_CENTER);
//DEL ::SetTextColor(lpDrawItemStruct->hDC, crOldColor);
//DEL
//DEL // CDialog::OnDrawItem(nIDCtl, lpDrawItemStruct);
//DEL }
好象没有起作用,OnDrawItem()会自动执行吧?