我无法解决我的错误:/
if (Cursor.Position = new Point(x, y)
我在x,y
上出错,我想更改为50,99
例如
答案 0 :(得分:0)
首先你应该触发mouseClick事件。这很简单:
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseClick);
然后你应该处理这个事件。假设您想要的位置是(x,y)=(100,100):
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
int xDesired = 100;
int yDesired = 100;
if (e.X == xDesired && e.Y == yDesired)
MessageBox.Show("Certain point clicked.");
}