我想每x秒模擬一次鼠標移動。為此,我將使用一個計時器(x秒),當計時器滴答時,我將使鼠標移動。但是,如何使用C#移動鼠標光標?
2 回答

慕蓋茨4494581
TA貢獻1850條經驗 獲得超11個贊
看看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);
}
- 2 回答
- 0 關注
- 539 瀏覽
添加回答
舉報
0/150
提交
取消