使用键盘按键进行表单导航 [英] form navigation using keyboard keys

查看:70
本文介绍了使用键盘按键进行表单导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在C#2008中的Windows应用程序中使用键盘的上,下,左,右箭头键在运行时在窗体之间移动.

How can I use up, down, left and right arrow keys of my keyboard in windows application in C# 2008 for moving among the form on runtime.

推荐答案

根据Walt的建议-使用Tab键使用默认导航选项.这不会使用户感到困惑.

如果您坚持使用箭头键(我希望我永远都看不到您的应用程序),那么您需要捕获keypress \ down \ up事件,确定您在表单上的位置,找到下一个控件.所需的方向,然后选择/设置该控件的焦点.
As suggested by Walt - use the default navigation option using the tab key. This will not confuse the users.

If you insist on using the arrow keys (I hope I never see your app) then you need to trap the keypress\down\up event, decide where you are on the form, locate the next control in the direction you want and select/ set focus on that control.


这篇关于使用键盘按键进行表单导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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