繁体   English   中英

检查按下鼠标左键的时间

[英]Check how long is pressed the left mouse button

如何查看单击鼠标右键的时间,以及处理点击中的某些事件?

例如:我有一个ListViewOnPreviewMouseLeftButtonDown事件和一个ListViewOnPreviewMouseLeftButtonUp事件,现在我想检查我实际按下鼠标左键的时间 - 没有计时器

在每个事件中使用DateTime变量:

DateTime start,end;

在羽绒事件中:

start=DateTime.Now;

在Up事件中:

 end=DateTime.Now;
 TimeSpan difference = end - start;
 double secs = difference.TotalSecs;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM