#include "stdafx.h"
#include "NumEdit.h"
#define VK_CTRL_X 0x18
#define VK_CTRL_C 0x03
#define VK_CTRL_V 0x16
// CNumEdit
IMPLEMENT_DYNAMIC(CNumEdit, CEdit)
CNumEdit::CNumEdit()
{
m_strValue = _T("");
m_nMaxValue = 0;
m_nMinValue = 0;
}
CNumEdit::~CNumEdit()
{
}
BEGIN_MESSAGE_MAP(CNumEdit, CEdit)
ON_WM_CHAR()
END_MESSAGE_MAP()
void CNumEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
int nCurserPos = 0;
if ((nChar>='0'&&nChar<='9')|| VK_BACK==nChar)
{
GetWindowText( m_strValue );
CString str;
int nLen = 0;
int nBegin = 0;
int nEnd = 0;
GetSel( nBegin, nEnd );
nLen = m_strValue.GetLength();
if( VK_BACK == nChar )
{