Char value from Keys class

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the e.KeyCode value from KeyEventArgs in KeyDown event handler and I
want to convert this in char value. It is posible? How?

The other case: If I have the Message class, I can convert the character
value to char?

Thank you for help!
 
Thank you for your answer.
This is workimg, but not in any situation. If I press numbers from the
numeric keyboard, the (char) e.KeyCode returns a, b, c, ...

Exist an other solution?

Thank you!

Mihaly
 
e.KeyCode returns the KeyCode which might be useful for keys like
Ctrl+C, Alt+F, etc
Try using
myChar = (char)e.KeyValue;


Hope that helps
 

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

Back
Top