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

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

问题描述

当我单击并双击wpf Image控件时,我试图有不同的行为。不幸的是,首先触发单击,所以双击将被忽略。

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事件, EventArgs中的 ClickCount 的属性。这可以让您了解用户在系统双击时间段内点击控件的次数。

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天全站免登陆