请问怎样让鼠标到达指定的坐标? System.Windows.Forms.Cursor.Position.X=100;System.Windows.Forms.Cursor.Position.Y=100; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 同意 alron(*落花有意随流水,而流水无心恋落花*) 的写法 无法修改“System.Windows.Forms.Cursor.Position”的返回值,因为它不是变量? yes,System.Windows.Forms.Cursor.Position是只读的 System.Windows.Forms.Cursor.Position是property试试这样写:System.Windows.Forms.Cursor.Position=new point(100,100); [DllImport("User32.dll")] public static extern bool SetCursorPos(int x,int y);//定位鼠标的位置 private void menuItem3_Click(object sender, System.EventArgs e) { SetCursorPos(100,100); } 不好意思,上面粘得有些随意了(与什么menuItem3_Click无关)更正如下:using using System.Runtime.InteropServices;[DllImport("User32.dll")]public static extern bool SetCursorPos(int x,int y);//定位鼠标的位置在使用的时候SetCursorPos(100,100);就OK了 请问,字符编码Encoding类的问题 HttpWebRequest 模拟登录问题--在线等 关于群发邮件的问题!大哥大姐们,帮帮忙!~不说也帮忙顶顶啊~~~ winform窗体 配置文件报错,麻烦高手帮忙,分数多多,祝大家新年快乐,谢谢啦 数据库链接不上,初学者的初级问题。 命名空间错误 大虾来帮看一下 郁闷一上午了..... 获取WebService接口信息 如何得到一个数据集:以当前年度为基准,前后五年 c#怎样才能调Delphi做的DLL 羽毛球问题:我有一个很要好的朋友 这vs.net文档应该怎么读
试试这样写:
System.Windows.Forms.Cursor.Position=new point(100,100);
public static extern bool SetCursorPos(int x,int y);//定位鼠标的位置 private void menuItem3_Click(object sender, System.EventArgs e)
{
SetCursorPos(100,100);
}
更正如下:
using using System.Runtime.InteropServices;[DllImport("User32.dll")]
public static extern bool SetCursorPos(int x,int y);//定位鼠标的位置在使用的时候
SetCursorPos(100,100);
就OK了