Reputation: 7020
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?
Upvotes: 1
Views: 3317
Reputation: 54714
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);
Upvotes: 4