| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 879 人关注过本帖
标题:diffcult problem.who can answer it?
只看楼主 加入收藏
虚拟现实
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-5-31
收藏
 问题点数:0 回复次数:2 
diffcult problem.who can answer it?
Visual C++6.0 environment.
Use API function.
There is a edit box.its id is EDIT1,its hwnd is hedit.
When you type character in the edit box .the color of the character is red.
How to do?
搜索更多相关主题的帖子: problem answer diffcult 
2005-05-31 18:01
mountain
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2005-5-28
收藏
得分:0 
CEdit *pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
 CDC *pDC = pEdit->GetDC();
 pDC->SetTextColor(RGB(255,0,0));
 CString str;
 GetDlgItemText(IDC_EDIT1,str);
 CRect rect;
 pEdit->GetClientRect(&rect);
 pDC->DrawText(str,&rect,DT_SINGLELINE);
 pEdit->ReleaseDC(pDC);
2005-06-01 23:10
mountain
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2005-5-28
收藏
得分:0 

上面的不对 这样才好 HBRUSH CDdDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

if(nCtlColor == CTLCOLOR_EDIT) { if(pWnd->GetDlgCtrlID() == IDC_EDIT1) { pDC->SetTextColor(RGB(255,0,0));//改变字体颜色 } } return hbr; }

2005-06-02 19:36
快速回复:diffcult problem.who can answer it?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017661 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved