zoukankan      html  css  js  c++  java
  • C# 获取鼠标在屏幕上的位置

    获取鼠标位置及鼠标单击了哪个按键。
    private void GetMousePoint()
    {
         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.label1.Text = "Left";           
         if (mb == System.Windows.Forms.MouseButtons.Right) this.label1.Text = "Right";
         if (mb == System.Windows.Forms.MouseButtons.Middle) this.label1.Text = "Middle";

    }

    //更新鼠标位置等信息。
    private void timer1_Tick(object sender, EventArgs e)
    {
         GetMousePoint();
    }



  • 相关阅读:
    kvm虚拟迁移(5)
    kvm虚拟化网络管理(4)
    计算系数
    排列组合
    错排
    加分二叉树
    皇宫看守
    战略游戏
    数字转换
    JDK8 HashMap源码分析
  • 原文地址:https://www.cnblogs.com/snsnetw/p/12366337.html
Copyright © 2011-2022 走看看