views:

53

answers:

1

I'm trying to get a char converted to System.windows.Form.Keys type or a string to a Keys array. Does anyone know how to do it in a simple way?

+2  A: 

The Keys codes for the numbers and uppercase letters match the corresponding ASCII codes. Assuming you're dealing with ASCII, you can do:

Keys key = (Keys) (byte) char.ToUpper(c);
Tim Robinson