UWP C# - 是否有按钮鼠标举行活动? [英] UWP C# - Is there a button mouse holding event?

查看:52
本文介绍了UWP C# - 是否有按钮鼠标举行活动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题是我有一个按钮,我希望在按下按钮时增加一个值(通过鼠标和/或触摸事件)。用鼠标有办法吗?我知道触摸有一个召唤事件,但是对于鼠标事件我没有看到任何类似于此的

The problem I am running into is I have a button, and I want a value to increase while the button is being held down(by a mouse and/or touch event). Is there a way to do with with a mouse? I know there is a holding event for touch, but I don't see any thing like this for mouse events.

谢谢!

推荐答案

有鼠标按下和鼠标按下事件。您可以在鼠标按下事件中启动计时器,并在计时器事件触发时增加变量。这将告诉您按住鼠标按钮多长时间。显然,你在鼠标向上
事件中停止计时器。
There are mouse-down and mouse-up events. You could start a timer in the mouse-down event and increment a variable when the timer event fires. This will tell you how long the mouse button has been held down. Obviously, you stop the timer in the mouse-up event.


这篇关于UWP C# - 是否有按钮鼠标举行活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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