如何使用C#移动鼠标光标?

我想每x秒模拟一次鼠标移动。为此,我将使用一个计时器(x秒),当计时器滴答时,我将使鼠标移动。

但是,如何使用C#移动鼠标光标?


海绵宝宝撒
浏览 496回答 2
2回答

慕盖茨4494581

看看Cursor.Position房产。它应该让你开始。private void MoveCursor(){   // Set the Current cursor, move the cursor's Position,   // and set its clipping rectangle to the form.    this.Cursor = new Cursor(Cursor.Current.Handle);   Cursor.Position = new Point(Cursor.Position.X - 50, Cursor.Position.Y - 50);   Cursor.Clip = new Rectangle(this.Location, this.Size);}
打开App,查看更多内容
随时随地看视频慕课网APP