void CLongEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
switch(nChar)
{
case _T('+'):
case _T('-'):
case _T('1'):
case _T('2'):
case _T('3'):
case _T('4'):
case _T('5'):
case _T('6'):
case _T('7'):
case _T('8'):
case _T('9'):
case _T('\b'):
break;
default:
MessageBeep(0);
return;
}
CEdit::OnChar(nChar, nRepCnt, nFlags);
}
for more further deatil http://www.flounder.com/validating_edit_control.htm