开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜