📄 subject_21329.htm
字号:
<p>
序号:21329 发表者:longren 发表日期:2002-11-16 00:48:11
<br>主题:怎么在CEditView中改变字体,颜色
<br>内容:例如打开字体对话框,颜色对话框,选定字体,颜色后,怎么使输入的字的字体,颜色改变。
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:树爱兵 回复日期:2002-11-16 10:00:30
<br>内容:CFontDialog 啊!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:longren 回复日期:2002-11-16 10:51:13
<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-11-16 11:44:28
<br>内容:用GetCurrentFont得到CFontDialog调用后设置的字体。<BR>再得到CEditView中的CEdit对象,调用它的SetFont函数来设置字体。<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>
回复者:longren 回复日期:2002-11-16 12:28:55
<br>内容:凯凯 你能不能把这句话的代码写出来啊,需不需要在OnDraw函数中添加代码。再得到CEditView中的CEdit对象,调用它的SetFont函数来设置字体
<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>回复者:凯凯 回复日期:2002-11-16 13:16:26
<br>内容:LOGFONT lf;<BR>//调用字体对话框,这个你会的,我就不写了<BR>fontDlg.GetCurrentFont(&lf);//取得指定的字体<BR>CFont font;<BR>font.CreateFontIndirect(&lf);<BR>yourEditView.GetEditCtrl().SetFont(&font);
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:longren 回复日期:2002-11-16 13:40:41
<br>内容:凯凯 ,我这么写的,当我选择字体后,变化的只是字体的间距,但是字体的大小依然没有变化。要到OnDraw中写代码? <BR>CFontDialog dlg;<BR>dlg.DoModal();<BR>LOGFONT lf;<BR>dlg.GetCurrentFont(&lf);<BR>CFont font;<BR>font.CreateFontIndirect(&lf);<BR>GetEditCtrl().SetFont(&font); <BR>2002-11-16 16:00:17
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -