C# 图像处理:获取鼠标位置信息(全局)

时间:2014-03-28 13:09:41   收藏:0   阅读:458
bubuko.com,布布扣
            Point ms = Control.MousePosition; //获取鼠标位置
            this.label2.Text = string.Format("{0}:{1}", ms.X, ms.Y);
            MouseButtons mb=  Control.MouseButtons; //获取鼠标按键

            if (mb == System.Windows.Forms.MouseButtons.Left) this.label3.Text = "Left";
            if (mb == System.Windows.Forms.MouseButtons.Right) this.label3.Text = "Right";
            if (mb == System.Windows.Forms.MouseButtons.Middle) this.label3.Text = "Middle";
bubuko.com,布布扣

通过以上代码可以获取鼠标在屏幕上的位置信息,以及鼠标按下的键的信息.

C# 图像处理:获取鼠标位置信息(全局),布布扣,bubuko.com

原文:http://www.cnblogs.com/lujin49/p/3629145.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!