📄 colorstatic.cpp
字号:
// ColorStatic.cpp : implementation file
/////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ColorStatic.h"
/////////////////////////////////////////////////////////
// CColorStatic
CColorStatic::CColorStatic()
{
m_ftSize = 90;
m_rgbText = RGB(255, 0, 0);
}
CColorStatic::~CColorStatic()
{
}
BEGIN_MESSAGE_MAP(CColorStatic, CStatic)
//{{AFX_MSG_MAP(CColorStatic)
ON_WM_CTLCOLOR_REFLECT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////
// CColorStatic message handlers
HBRUSH CColorStatic::CtlColor(CDC* lpDC, UINT nCtlColor)
{
lpDC->SetBkMode(TRANSPARENT);
lpDC->SetTextColor(m_rgbText);
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
void CColorStatic::PreSubclassWindow()
{
CStatic::PreSubclassWindow();
// 重新设置字体
m_ftFont.CreatePointFont(m_ftSize, "宋体");
SetFont(&m_ftFont, TRUE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -