In my text box i want the user to be able to enter in something like 1.2 or -1.5 but no letters. Is there something to allow me to do that because ES_NUMBER only lets the user enter in numerals.
Printable View
In my text box i want the user to be able to enter in something like 1.2 or -1.5 but no letters. Is there something to allow me to do that because ES_NUMBER only lets the user enter in numerals.
I'm not familiar with ES_NUMBER - what language are you using? If I knew the language I could probably write you more specific code. Maybe this could help:
If you could find a way to recieve each character either before or as soon as it is added to the text box, you could check it. Maybe do a series of if statements (keeping this as language-unspecific as possible) to find out if it is a valid character, like a number, a . or a - (or you may decide to allow , also). If it is, just proceed as normal. If it isn't either block it from going into the text box or if it's already there, remove, and then read the next character.
im doing Win32 programming in C
Adrianxw provides a sample of subclassing the edit control here:
http://cboard.cprogramming.com/showthread.php?t=37848
Search for more samples here:
http://cboard.cprogramming.com/searc...searchid=46310