#pragma once
/*
Title:改变MFC CCheckBox控件默认字体的颜色
Test Environment: VS2013Update3
Author: kagula
LastUpdateDate:2014-10-20
*/
class CCheckBox : public CButton
{
DECLARE_DYNAMIC(CCheckBox)
public:
CCheckBox();
virtual ~CCheckBox();
protected:
DECLARE_MESSAGE_MAP()
public:
COLORREF m_clrFore;
COLORREF m_clrBK;
int m_fontSize;
afx_msg void OnPaint();
};
// CheckBox.cpp : implementation file
//
#include "stdafx.h"
#include "cat8637_brand.h"
#include "CheckBox.h"
// CCheckBox
IMPLEMENT_DYNAMIC(CCheckBox, CButton)
CCheckBox::CCheckBox()
{
m_clrFore = RGB(127, 127, 127);
m_clrBK = RGB(255, 255, 255);
m_fontSize = 100;
}
CCheckBox::~CCheckBox()
{
}
BEGIN_MESSAGE_MAP(CCheckBox, CButton)
ON_WM_PAINT()
END_MESSAGE_MAP()
// CCheckBox message handlers
void CCheckBox::OnPaint()
{
CPaintDC