加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

C#中的Numpad键代码

发布时间:2020-12-16 00:20:12 所属栏目:百科 来源:网络整理
导读:我使用以下代码来处理小键盘键. if (e.KeyCode == Keys.NumPad0 || e.KeyCode == Keys.D0){ MessageBox.Show("You have pressed numpad0");}if (e.KeyCode == Keys.NumPad1 || e.KeyCode == Keys.D1){ MessageBox.Show("You have pressed numpad1");} 还有其
我使用以下代码来处理小键盘键.

if (e.KeyCode == Keys.NumPad0 || e.KeyCode == Keys.D0)
{
   MessageBox.Show("You have pressed numpad0");
}
if (e.KeyCode == Keys.NumPad1 || e.KeyCode == Keys.D1)
{
   MessageBox.Show("You have pressed numpad1");
}

还有其他小键盘键.但是我想知道我怎么能为这个位于小键盘旁边的“”,“*”,“/”,“ – ”,“.”.

提前致谢

解决方法

查看整个 Keys enum.你有Keys.Mutiply,Keys.Add等等.

请注意,Keys.D0不是numpad 0,它是非numpad 0.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读