如何根据加载的索引使鼠标移动? [英] How do I make the mouse move according to the loaded indexes?

查看:76
本文介绍了如何根据加载的索引使鼠标移动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在开发一个类似于宏录制器的应用程序,我正在录制鼠标移动和键盘。在应用程序(C#)中,我可以记录鼠标移动并重放它。但我坚持在保存鼠标位置后我可以加载位置(我已经加载为listBox中的文本),现在我需要让鼠标读取这些位置(在listBox中)并移动。我没有代码向你展示,因为我被困在这个部分

任何人都可以帮帮我吗?



什么我试过了:



我没有代码可以显示但是我在[play]按钮中有这个代码



private void button2_Click(object sender,EventArgs e)

{



manager.ExecuteActions();

}

So I am working on an application similar to macro recorder, where I am recording the mouse movement and the keyboard. In the application (C#), I can record the mouse movement and replay it. But am stuck at the point where after saving the position of the mouse I can load the position (and I have loaded as a text in a listBox) and now I need to make the mouse read these position (in the listBox) and move. I don't have a code to show you because am stuck at this part
Could anyone help me out?

What I have tried:

I dont have code to show but this what i have in my [play] button

private void button2_Click(object sender, EventArgs e)
{

manager.ExecuteActions();
}

推荐答案

如果我理解你的问题并认为这是Windows Forms,你可以用 Control.MouseMove事件(System.Windows.Forms) [ ^ ]并获取或设置位置 Cursor.Position属性(System.Windows.Forms) [ ^ ]
If I understand your question correctly and taken that this is Windows Forms, you can track mouse movement with Control.MouseMove Event (System.Windows.Forms)[^] and get or set the position with Cursor.Position Property (System.Windows.Forms)[^]


这篇关于如何根据加载的索引使鼠标移动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆