C# - Cursor position (all screen) [duplicate]
问题 This question already has answers here : Getting mouse position in c# (10 answers) Closed 6 years ago . help me please! :) My program should get cursor position (all screen) every ~50 ms and them write in text Box . How it make? Example: private void Form1_MouseMove(object sender, MouseEventArgs e) { textBox1.Text = e.X.ToString(); textBox2.Text = e.Y.ToString(); } but we get position only in window it's really do? 回答1: you can use Cursor.Position : textBox1.Text = Cursor.Position.X.ToString(