⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_19137.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:19137 发表者:小小阿胖 发表日期:2002-10-25 17:19:46
<br>主题:改变静态字体颜色
<br>内容:哪位能告诉我,在VC中,如何改变窗口中静态文字的颜色???<BR>TKS!!!
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:^_^ 回复日期:2002-10-25 17:26:34
<br>内容:在WM_CTLCOLOR消息中处理<BR><BR>HBRUSH CExeTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;// TODO: Change any attributes of the DC here<BR>&nbsp;&nbsp; if (nCtlColor==CTLCOLOR_EDIT&nbsp;&nbsp; )<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Set the text color <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pDC-&gt;SetTextColor(RGB(255,0,0));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pDC-&gt;SetBkColor(RGB(0,0, 255));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Set the background mode for text to transparent <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// so background will show thru.<BR>&nbsp;&nbsp; //&nbsp;&nbsp; pDC-&gt;SetBkMode(TRANSPARENT);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;// TODO: Return a different brush if the default is not desired<BR>&nbsp;&nbsp;&nbsp;&nbsp;return hbr;<BR>}<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:凯凯 回复日期:2002-10-25 21:04:48
<br>内容:http://www.vchelp.net/cndevforum/subject_view.asp?subject_id=19046&forum_id=
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -