当主窗体失去焦点时,HardwareButton键事件丢失 [英] HardwareButton key events lost when main form looses focus

查看:106
本文介绍了当主窗体失去焦点时,HardwareButton键事件丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WM5应用程序中使用的是硬件按钮,几乎完全按照文档所说的那样顺利运行,直到.....你的主要形式失去对一个(子)按钮的焦点(位于主要形式)。

我也尝试将焦点重新恢复到主窗体但是调用它。从定时器上调用它主要是不起作用 - 可能是线程问题(?)。

提前感谢任何提示!
tb

I am using HardwareButtons in a WM5 app pretty much exactly along the lines the doc says and it works well until.....
the main form looses focus that goes to a (child) button (located on the main form).

Also I tried to reinstate focus to the main form but calling this.Activate() on it main from a timer seems not to work - possibly a thread issue (?).

Thanks ahead for any hints!
tb

推荐答案

不确定是否通过HardwareButtons表示实际按钮或某些按钮一种组件。如果是前者,将表单的KeyPreview属性设置为true通常会达到预期的效果。
Not sure whether by HardwareButtons you mean actual buttons or some kind of component. If it's the former, setting form's KeyPreview property to true usually works to the desired effect.


这篇关于当主窗体失去焦点时,HardwareButton键事件丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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