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

📄 subject_38017.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:38017 发表者:苦闷 发表日期:2003-04-30 09:41:09
<br>主题:急。高分
<br>内容:怎么样使静态控件的字体,闪烁。
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:苦闷 回复日期:2003-04-30 11:44:33
<br>内容:static int i=0;<BR>BOOL CTestDlg::OnInitDialog()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;SetTimer(1,1000,NULL);<BR>&nbsp;&nbsp;&nbsp;&nbsp;return TRUE;&nbsp;&nbsp;// return TRUE&nbsp;&nbsp;unless you set the focus to a control<BR>}<BR><BR>void CTestDlg::OnTimer(UINT nIDEvent) <BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;CWnd *pWnd=GetDlgItem(IDC_1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;CDC *pDC=GetDC(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;i++;<BR>&nbsp;&nbsp;&nbsp;&nbsp;OnCtlColor(pDC,pWnd,CTLCOLOR_STATIC); <BR>&nbsp;&nbsp;&nbsp;&nbsp;if(i==10)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;KillTimer(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;i=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;CDialog::OnTimer(nIDEvent);<BR>}<BR>HBRUSH CTestDlg::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;if(i%2==0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pDC-&gt;SetTextColor(RGB(255, 0, 0));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pDC-&gt;SetTextColor(RGB(255, 255, 0));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return hbr;<BR>}<BR>怎么该为了这样,我想静态控件中的字体颜色每1秒种变化一次,怎么没有啊。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:neilgan 回复日期:2003-04-30 12:41:23
<br>内容:You should call InvalidateRect in OnTimer and SetTextColor in OnCtlColor<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>
<font color=red>答案被接受</font><br>回复者:林建华 回复日期:2003-04-30 19:27:18
<br>内容:OnCtlColor(pDC,pWnd,CTLCOLOR_STATIC); <BR>&nbsp;&nbsp;&nbsp;&nbsp;改成Invalidate()
<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 + -