All I want to do is get the actual character, which is pressed whenever the key for the event is entered.
The only option I see is e.KeyChar , which will give me a position, not the character itself.
What I want to do is limit the keypress values ββto numbers from 0 to 9. The way I'm doing it now is just if((e.KeyChar < 48 || (e.KeyChar > 57)))
It seems a little cheap to just enter the values ββfor 0 and 9, and I would like to know how to get the value of the character, not its key.
EDIT: Thanks for the input; therefore there is generally no way to go from the value of e.KeyChar to the value of the input itself.
I would really like to accept my event, and access the character pressed directly, and not use e.KeyChar to get a numerical representation of this value.
source share