View Full Version : Only allowing certain types of input?

10-24-2007, 04:55 AM
I totally dont remember how to do this:

I have some text boxes, which should only accept integers, but i cant remember how to give an error if the user enters a letter instead of a number.

and ideas?

its in C#


10-24-2007, 04:57 AM
Not sure about C#, but in C++ I would compare the hex value of each inputted character to make sure it fell inside the alphabets acceptable range. I could give you some pseudo code but I'm not that familiar with C#.

10-24-2007, 05:09 AM
I don't even code in C#, and I found the answer. So many languages are the same, you just have to know what to look for.


Some languages actually have methods like isString and isInteger