[C#]003_My003App_显示鼠标位置

003_My003App_显示鼠标位置

Code:

private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            string X = e.X.ToString();    /*定义X的坐标*/
            string Y = e.Y.ToString();    /*定义Y的坐标*/
            lblMouseStatus.Text = "鼠标位置(" + X + "," + Y + ")";
            /*将鼠标的坐标赋值给标签并显示出来*/
        }

 

参考下图:

image

你可能感兴趣的:(职场,鼠标,位置,休闲)