WinMobile Button的事件(Click,KeyDown,KeyUp) [英] WinMobile Button's Event(Click,KeyDown,KeyUp)

查看:77
本文介绍了WinMobile Button的事件(Click,KeyDown,KeyUp)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对按钮的事件有疑问.
在我的PJ中,我希望激活单击并按住一个按钮时的结果:

1)> 2秒->显示您确定..."
2)< = 2秒->显示确定"

我的想法:
1)keyDown/Click->将当前的DateTime记录为dtKeyDow
2)KeyUp-> DateTime.Now-dtKeyDow
不幸的是,当我单击此按钮时,它将永远不会执行KeyUp事件.

所以,我需要你的帮助,请! TKS ...

:sigh:

I have a question about button''s event.
In my PJ, I want active the results that when I click and hold a button:

1) > 2 second''s -> show ''Are you sure ...''
2) <= 2 second''s -> show ''OK''

My thinks:
1) keyDown/Click -> Record current DateTime as dtKeyDow
2) KeyUp -> DateTime.Now - dtKeyDow
Unfortunately, when I click this Button, that never execute the KeyUp event.

So, I need you help, Please! TKS...

:sigh:

推荐答案

KeyDown/KeyUp事件仅用于键盘按键,对于鼠标按键,您需要访问MouseUp/MouseDown事件,您的问题是.Net紧凑框架无法访问按钮的这些事件,因此您需要创建自己的按钮.

看看 [
The KeyDown/KeyUp events are only for keyboard key presses, for mouse button presses you need access to the MouseUp/MouseDown event, your problem is that the .Net compact framework doesn''t give access to these events for buttons so you would need to create you own button.

Have a look at this[^] MSDN article.


:confused::(:sigh :!!!!!!!!!!!
:confused: :( :sigh: !!!!!!!!


这篇关于WinMobile Button的事件(Click,KeyDown,KeyUp)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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