Win32:为 Rich Edit 设置默认字体和文本颜色 [英] Win32 : set default font and text color for rich edit

查看:43
本文介绍了Win32:为 Rich Edit 设置默认字体和文本颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这应该是一个简单的问题,但我无法在谷歌上找到答案:如何使用纯 c++ 和 win32 为 Richedit 设置默认字体和颜色?

It should be an easy question but I was unable to find an answer on google: How to set a default font and color to a richedit using plain c++ and win32 ?

推荐答案

来自 MSDN:

您还可以使用 EM_SETCHARFORMAT 和 EM_GETCHARFORMAT 消息来设置和检索插入点的字符格式,这是应用于任何后续插入字符的格式.例如,如果应用程序将默认字符格式设置为粗体,然后用户键入一个字符,则该字符为粗体.

You can also use EM_SETCHARFORMAT and EM_GETCHARFORMAT messages to set and retrieve the character formatting of the insertion point, which is the formatting that is applied to any subsequently inserted characters. For example, if an application sets the default character formatting to bold and the user then types a character, that character is bold.

这就是你要找的吗?

这篇关于Win32:为 Rich Edit 设置默认字体和文本颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆