当前位置:编程学习 > C#/ASP.NET >>

获取鼠标双击时间间隔问题,不论鼠标是否双击或双击速度,程序运行时始终显示时间为500毫秒,谢谢大家帮忙

获取鼠标双击时间间隔问题,不论鼠标是否双击或双击速度,程序运行时始终显示时间为500毫秒,谢谢大家帮忙
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace GetMouseTimeSpan
{
      
    public partial class Frm_Main : Form
    {
        public Frm_Main()
        {
            InitializeComponent();
        }
        [DllImport("user32.dll",EntryPoint="GetDoubleClickTime")]
        public extern static int GetDoubleClickTime();
        private void Frm_Main_Load(object sender, EventArgs e)
        {
            label1.Text = GetDoubleClickTime() + "毫秒";
        }

    }
}
运行结果:500毫秒 C# --------------------编程问答-------------------- 这个函数是用来判断连续两次鼠标单击之间会被处理成双击事件的间隔时间。是你系统配置的,当然是固定值。 --------------------编程问答-------------------- 额~不好意思~还是不是很懂~~能麻烦说详细一点吗?谢谢啊~嘿嘿 --------------------编程问答-------------------- 额,我也不知道啊 --------------------编程问答-------------------- Windows会利用这个方法来判定你连续两次单击是否为一次双击。如果连续两次单击的时间间隔小于等于这个函数的返回值,则Windows会认为你进行了一次双击。
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,