如何使用箭头键而不是Tab键 [英] how to use arrow keys instead of tab key

查看:141
本文介绍了如何使用箭头键而不是Tab键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我想知道如何使用箭头键而不是Tab键.
我使用了这段代码,但是没有用:

Hello
I want to know how to use arrow keys instead of tab key.
I used this code but it didn''t work :

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
      If e.KeyCode = Keys.Up Then
          ProcessTabKey(True)
          e.Handled = True
      ElseIf e.KeyCode = Keys.Down Then
          ProcessTabKey(False)
          e.Handled = True
      End If
  End Sub


那是什么问题呢?
在此先谢谢您..


So ,what''s the problem?
Thank in advance..

推荐答案

可能,您有一些控件可以从键盘上进行输入-如果您这样做,它们将获取事件而不是表格.
您可以通过将Form.KeyPreview设置为true来强制表单获取此类事件,但是在更改此类基本行为之前,我会想一想-如果用户不习惯这种行为,则可能会造成混淆,从而给人留下不良印象您的软件.
Probably, you have controls which can take input from the keyboard - if you do they they get the event instead of the form.
You can force the form to get such events by setting the Form.KeyPreview to true, but I would think hard before changing fundamental behaviour like that - if users are not used to it, then you can confuse them and that can create a bad impression of your software.


这篇关于如何使用箭头键而不是Tab键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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