📄 comboex.cpp
字号:
// ComboEx.cpp : implementation file
//
#include "stdafx.h"
#include "24Dian.h"
#include "ComboEx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CComboEx
CComboEx::CComboEx()
{
m_brush.CreateSolidBrush(RGB(255,255,255));
m_color=RGB(255,0,0);
}
CComboEx::~CComboEx()
{
}
BEGIN_MESSAGE_MAP(CComboEx, CComboBox)
//{{AFX_MSG_MAP(CComboEx)
ON_WM_CTLCOLOR_REFLECT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CComboEx message handlers
void CComboEx::SetFont(LOGFONT logfont)
{
m_font.DeleteObject();
m_font.CreateFontIndirect(&logfont);
CComboBox::SetFont(&m_font,FALSE);
}
void CComboEx::SetColor(COLORREF color)
{
m_color=color;
}
HBRUSH CComboEx::CtlColor(CDC* pDC, UINT nCtlColor)
{
// TODO: Change any attributes of the DC here
pDC->SetTextColor(m_color);
// TODO: Return a non-NULL brush if the parent's handler should not be called
return (HBRUSH)m_brush.GetSafeHandle();
// return HBRUSH(GetStockObject(HOLLOW_BRUSH));
// return NULL;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -