处理点击"Tab"按钮ComboBox和TextBox上的键 [英] Handle click of "Tab" key on ComboBox and TextBox

查看:72
本文介绍了处理点击"Tab"按钮ComboBox和TextBox上的键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想通过代码处理用户在CombBox和TextBox上单击时Tab键的行为,
我试图在ComboBox的KeyUp和KeyDown事件上捕获它,但是我不能!
谁能帮助我,谢谢...

Hi,
I want to handle by code the behavior of the tab key when user clicks it on a CombBox and TextBox,
I tried to catch it on KeyUp and KeyDown events of ComboBox, but I couldn''t!!
Can any one help me plz, thx...

推荐答案

这是PreviewKeyDown事件.这就是全部.
Do this is PreviewKeyDown event. That''s all it takes.
If e.KeyCode = Keys.Tab Then
  e.IsInputKey = True
End If


Form.KeyPreview设置为true并在表单级别处理Key事件.
Set Form.KeyPreview to true and handle the Key events at the form level.


这篇关于处理点击"Tab"按钮ComboBox和TextBox上的键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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