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
 
Back
Top