basedatetimectrl.cpp

来自「一个有关人事系统的所有代码和有关文件包括里面小量数据库。」· C++ 代码 · 共 61 行

CPP
61
字号
// BaseDateTimeCtrl.cpp : implementation file
//

#include "stdafx.h"
#include "Rsglxt.h"
#include "BaseDateTimeCtrl.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBaseDateTimeCtrl

CBaseDateTimeCtrl::CBaseDateTimeCtrl()
{
}

CBaseDateTimeCtrl::~CBaseDateTimeCtrl()
{
}


BEGIN_MESSAGE_MAP(CBaseDateTimeCtrl, CDateTimeCtrl)
	//{{AFX_MSG_MAP(CBaseDateTimeCtrl)
	ON_WM_CTLCOLOR_REFLECT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CBaseDateTimeCtrl message handlers

BOOL CBaseDateTimeCtrl::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	if(pMsg->message==WM_KEYDOWN && pMsg->wParam==13)
		pMsg->wParam=9;		
	return CDateTimeCtrl::PreTranslateMessage(pMsg);
}

HBRUSH CBaseDateTimeCtrl::CtlColor(CDC* pDC, UINT nCtlColor) 
{
	// TODO: Change any attributes of the DC here
	CDC* dc = GetDC(); //获取画布对象
	CRect rect;
	GetClientRect(rect); //获取客户区域
	rect.InflateRect(1,1,1,1);//将客户区域增大一个像素
	CBrush brush (m_Colour);//创建画刷
	dc->FrameRect(rect,&brush);//绘制边框
	// TODO: Return a non-NULL brush if the parent's handler should not be called
	return NULL;
}

void CBaseDateTimeCtrl::SetColour(COLORREF Colour)
{

	m_Colour = Colour;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?