鼠标单击总次数 [英] total number Mouse click periods

查看:93
本文介绍了鼠标单击总次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友...

1.在我的表单中计算该时段内的鼠标点击次数.
有人帮我吗?

hello friends...

1.Count Number of click by mouse in that periods in my form.
anybody help me?

推荐答案

您将需要处理窗体MouseClick事件,并在每次触发时增加一个类级别计数器.此外,您将需要将事件处理程序挂接到表单的Controls集合中的每个控件上(并可能将它们递归每个表单).然后,您可以在计时器中获取该值,然后清除它,或者从中减去最后点击"值以获取一个时间段内的数字.
You will need to handle the form MouseClick event, and increment a class level counter each time it fires. In addition, you will need to hook the event handler to each control in the Controls collection for the form (and probably recurse this for each of them). You can then get the value in a timer, and either clear it, or subtract a "last clicks" value from it to get the number in a time period.


您好,

取一个全局整数变量并将其初始化为0.

接下来,处理您的Window窗体的click事件,如下所示:

Hi,

Take a global integer variable and initialize it with 0.

Next handle the click event of your Window form as shown below:

private void frmTest_Click(object sender, EventArgs e)
 {

}



在这里,frmTest是窗口窗体的名称.

只需增加click事件中变量的值即可.

------
快乐编码:)



Here, frmTest is Name of Window Form.

Just increment the value of variable on click event.

------
Happy Coding :)


这篇关于鼠标单击总次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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