One option is to use the class wizard and assign a member variable to the edit control and assign the data type by selecting the appropriate data type (i.e. int, uint, long, double, float, etc.) This will allow only numeric values. You can also assign a valid range for the edit box.
If you create a derived class from CEdit and overwrite the
fuction OnChar() ( WM_CHAR ) than you can prevent alpha-characters coming in to the control:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.