净KeyEventArgs收益与进入 [英] .Net KeyEventArgs return vs enter

查看:204
本文介绍了净KeyEventArgs收益与进入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#.NET应用程序有这样的:

Have this in a c# .net application:

字符串键= e.Key code.ToString();

string key = e.KeyCode.ToString();

在.NET 1.1的key =输入

in .net 1.1 key = "enter"

在.NET 3.5中的key =回归

in .net 3.5 key = "return"

我的问题是,为什么有不同?

my question is why are they different?

推荐答案

枚举具有相同的值输入返回(它也有其他一些重复的)。该框架选择了不同的值的ToString

The Keys enum has identical values for Enter and Return (it also has a number of other duplicates). The framework chose a different value in ToString.

这篇关于净KeyEventArgs收益与进入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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