gpt4 book ai didi

windows-runtime - 将e.key转换为char

转载 作者:行者123 更新时间:2023-12-04 18:33:21 25 4
gpt4 key购买 nike

有什么方法可以将e.Key存储应用中的char Textbox事件中的keyDown转换为Windows 8

这是我的代码:

private void OnTextBoxKeyDown(object sender, KeyRoutedEventArgs e)
{
EcgStatementText.Text = (e.Key); // We should convert e.Key to chars
}

最佳答案

string result = ((Char)e.Key).ToString();


如果要获取数字键盘的值,请查看以下问题: How do I convert a "Keys" enum value to an "int" character in C#?

关于windows-runtime - 将e.key转换为char,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18740890/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com