简体   繁体   English

使用DoubleClick捕获C#表单外部的x,y坐标

[英]Using doubleclick to catch x,y coordinates outside of a form C#

I'm making a form application in C# and what I need is to able to capture x,y coordinates outside of the form when the user doubleclicks. 我正在用C#开发一个表单应用程序,我需要的是当用户双击时能够捕获表单外部的x,y坐标。 I have not been able to find anything that can help me. 我找不到任何可以帮助我的东西。 I'm new to C# so I might be looking for the wrong thing. 我是C#的新手,所以我可能正在寻找错误的东西。 Any help would be appreciated. 任何帮助,将不胜感激。

Thanks, 谢谢,

This old MSDN blog has sample code for using WH_MOUSE_LL , a low-level mouse hook that you can use to capture mouse events in Windows. 这个古老的MSDN博客包含使用WH_MOUSE_LL示例代码, WH_MOUSE_LL是一个低级鼠标挂钩,可用于捕获Windows中的鼠标事件。 Mouse hooks do not distinguish double clicks however, you will need to do that yourself. 鼠标钩不能区分双击,但是,您需要自己进行。 You can use SystemInformation.DoubleClickTime and a timer to determine if the click was a double click or not. 您可以使用SystemInformation.DoubleClickTime和计时器来确定单击是否为双击。

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

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