单击并双击同一图像控件(wpf) [英] Single click and double click on the same Image control(wpf)

查看:251
本文介绍了单击并双击同一图像控件(wpf)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我单击和双击wpf图像控件时,我试图有不同的行为。

I am trying to have different behaviours when single clicking and double clicking the wpf Image control. Unfortunately the single click is fired first, so the double click is ignored.

推荐答案

如果您使用MouseDown事件,属性在 ClickCount 的EventArgs中。这允许您知道用户在系统的双击时间范围内点击控件的次数。

If you use the MouseDown event instead it has a property in the EventArgs for ClickCount. This allows you to know how many times the user has clicked on the control within the system's double click time span.

您可以使用此功能来实现您自己的逻辑,以决定双击和单击之间。

You can probably use this to implement your own logic for deciding between a double and single click.

这篇关于单击并双击同一图像控件(wpf)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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