16,473
社区成员
发帖
与我相关
我的任务
分享
OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
if((nChar>='0'&&nChar<='9')||nChar=='.')
{
if(nChar=='.')
{
CString str;
GetWindowText(str);
if(str.GetLength()>0)
{
if(str.Find('.')>=0)
AfxMessageBox("不能输入第二个小数点");
else
CEdit::OnChar(nChar, nRepCnt, nFlags);
}
else
AfxMessageBox("小数点不能在第一位");
}
else
CEdit::OnChar(nChar, nRepCnt, nFlags);
}
else
AfxMessageBox("输入有误");
}
OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
if((nChar>='0'&&nChar<='9')||nChar=='.')
CEdit::OnChar(nChar, nRepCnt, nFlags);
else
AfxMessageBox("输入有误");
}