C#怎么控制鼠标移动?
1个回答
展开全部
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;namespace WindowsApplication10
{
public partial class Form1 : Form
{
[DllImport("user32.dll")]
private static extern int SetCursorPos(int x, int y); public Form1()
{
InitializeComponent();
}
int i = 0; private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 10000; } private void timer1_Tick(object sender, EventArgs e)
{
i = i + 3;
SetCursorPos(i, i);
}
}
}希望对你有所帮助。。。
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;namespace WindowsApplication10
{
public partial class Form1 : Form
{
[DllImport("user32.dll")]
private static extern int SetCursorPos(int x, int y); public Form1()
{
InitializeComponent();
}
int i = 0; private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 10000; } private void timer1_Tick(object sender, EventArgs e)
{
i = i + 3;
SetCursorPos(i, i);
}
}
}希望对你有所帮助。。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询