mromeo
asked on
How to restrict CEdit to all number types...including negative numbers
Hi. I want to restrict my CEdit box to numeric values only, but I also want to allow negative numbers. Using the ES_NUMBER flag doesn't allow anything below 0. Anybody know if there is a way to do this with a flag or do I need to make it a regular CEdit and check the values myself?
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BOOL CYourDlg::PreTranslateMess
{
if (pMsg->message==WM_CHAR)
if (!isdigit(pMsg->wParam) && pMsg->wParam!='-' && pMsg->hwnd==GetDlgItem(YOU
return TRUE;
return CDialog::PreTranslateMessa
}