为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

C#
海绵宝宝撒 2019-08-31 15:55:49
我想每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);

}


查看完整回答
反对 回复 2019-08-31
  • 2 回答
  • 0 关注
  • 493 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信