博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C# 图像处理:获取鼠标位置信息(全局)
阅读量:7061 次
发布时间:2019-06-28

本文共 475 字,大约阅读时间需要 1 分钟。

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";

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

转载地址:http://eeyll.baihongyu.com/

你可能感兴趣的文章