MFC - change text color of a cstatic text control(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()
/