📄 numberedit.cpp
字号:
// NumberEdit.cpp : implementation file
//
#include "stdafx.h"
#include "qpglxt.h"
#include "NumberEdit.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNumberEdit
CNumberEdit::CNumberEdit()
{
}
CNumberEdit::~CNumberEdit()
{
}
BEGIN_MESSAGE_MAP(CNumberEdit, CEdit)
//{{AFX_MSG_MAP(CNumberEdit)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNumberEdit message handlers
BOOL CNumberEdit::PreTranslateMessage(MSG* pMsg)
{
//如果输入的字符不是1~9或“.”或其它功能键
if(pMsg->message==WM_KEYDOWN )
{ if((pMsg->wParam<0x30 || pMsg->wParam>0x39) && pMsg->wParam!=190 && pMsg->wParam!=8 && pMsg->wParam!=13)
if(pMsg->wParam<VK_NUMPAD0 || pMsg->wParam>VK_NUMPAD9)// &&&& pMsg->wParam!=VK_PERIOD
pMsg->wParam=VK_CONTROL;
if( pMsg->wParam==13)
pMsg->wParam=9;
}
return CEdit::PreTranslateMessage(pMsg);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -