Convert a string, char type to System.Windows.Forms.Keys
I'm trying to get a char converted to System.windows.Form.Keys type or a string to a Keys array. Does anyone know h开发者_开发知识库ow to do it in a simple way?
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);
精彩评论