How to get the Character value when using KeyPress?

K

Keith Smith

How can I get the character value of a KeyPress?

I tried this...
MessageBox.Show(e.KeyChar.ToString());

....but it only gives me the actual character itself. For example, if the
user presses "Enter" I need the value of 13 returned to me. Keep in mind
that this is a KeyPress and not a KeyUp or KeyDown which utilize KeyValue
for this.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top