📄 basedatetimectrl.cpp
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -