number validation
-
i have an edit control on dialog box and i am not using MFC, i want to validate that only numbers should be entered in the field. what is the possible way out. help me out PLZ
You're better off doing it yourself anyhow. Handle WM_KEYDOWN in the edit control, and then you can do your own validation. You can set the number style, or if you need negative numbers or decimals, you can deal with that in the same message. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
-
i have an edit control on dialog box and i am not using MFC, i want to validate that only numbers should be entered in the field. what is the possible way out. help me out PLZ
In the resource editor with the dialog box displayed, right click the edit control, select properties, select the styles tab, then check the Number checkbox. This will allow only the digits 0-9.
-
You're better off doing it yourself anyhow. Handle WM_KEYDOWN in the edit control, and then you can do your own validation. You can set the number style, or if you need negative numbers or decimals, you can deal with that in the same message. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
Christian Graus wrote: Handle WM_KEYDOWN in the edit control Actually, I think he would be better off handling the EN_UPDATE notification, that way he can properly validate any text that is pasted into the edit control. --- CPUA 0x5041 Sonork 100.11743 Chicken Little Within you lies the power for good - Use it!