键盘箭头任务的代码 [英] code for the keyboard arrows tasks

查看:96
本文介绍了键盘箭头任务的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我正在开发一个项目,其中一部分涉及键盘箭头(左,右,上和下),每个按钮有4个按钮,用于执行特定箭头的任务.

hi all
i''m working on a project, there is a part of it concerning of keyboard arrows(left, right, up and down), and there is 4 buttons each button do the task of a specific arrow.
what is the code to let the button do the task for the arrow?

推荐答案

您知道吗,取决于获得焦点的控件,箭头键是什么?他们可能已经执行或尚未执行特定操作?我们必须知道您要完成的工作,然后才能为您提供准确的问题答案.

编辑====================

将事件处理程序添加到您的窗体中以进行keydown和keyup,并在这些处理程序中确定键是否为箭头键.请记住,标准键盘上有两个箭头键.
Are you aware that depending on the control that''s got focus, the arrow keys may or may not already have a specific action they perform? We have to know what you''re trying to accomplish before we can give you a precise answer to your question.

EDIT ======================

Add event handlers to your form for keydown and keyup, and inside those handlers, determine if the keys are arrow keys. Remember, there are two sers of arrow keys on a standard keyboard.


这篇关于键盘箭头任务的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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