MFC - change text color of a cstatic text control(MFC - 更改 cstatic 文本控件的文本颜色)
本文介绍了MFC - 更改 cstatic 文本控件的文本颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何更改 CStatic 文本控件的文本颜色?除了使用 CDC::SetTextColor 之外,还有其他简单的方法吗?
How do you change the text color of a CStatic text control? Is there a simple way other that using the CDC::SetTextColor?
谢谢...
推荐答案
您可以在对话框类中实现 ON_WM_CTLCOLOR
,而无需创建新的 CStatic 派生类:
You can implement ON_WM_CTLCOLOR
in your dialog class, without having to create a new CStatic-derived class:
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
//{{AFX_MSG_MAP(CMyDialog)
ON_WM_CTLCOLOR()
/
沃梦达教程
本文标题为:MFC - 更改 cstatic 文本控件的文本颜色


猜你喜欢
- C++ 协变模板 2021-01-01
- 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01
- 从python回调到c++的选项 2022-11-16
- 静态初始化顺序失败 2022-01-01
- STL 中有 dereference_iterator 吗? 2022-01-01
- Stroustrup 的 Simple_window.h 2022-01-01
- 使用/clr 时出现 LNK2022 错误 2022-01-01
- 近似搜索的工作原理 2021-01-01
- 如何对自定义类的向量使用std::find()? 2022-11-07
- 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01