什么是C#等效的ChrW(e.KeyCode)? [英] What is the C# equivalent of ChrW(e.KeyCode)?

查看:346
本文介绍了什么是C#等效的ChrW(e.KeyCode)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB.NET 2008中,我使用了以下语句:

In VB.NET 2008, I used the following statement:

MyKeyChr = ChrW(e.KeyCode)

现在我要将上面的语句转换为C#。

Now I want to convert the above statement into C#.

任何想法?

推荐答案

看起来像C#的等效

var MyKeyChr = char.ConvertFromUtf32((int) e.KeyCode)


$ b b

但是, e.KeyCode 不包含Unicode代码点,因此此转换无意义。

However, e.KeyCode does not contain a Unicode codepoint, so this conversion is meaningless.

这篇关于什么是C#等效的ChrW(e.KeyCode)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆