My code is used to form1
private int X,Y;
private void timer1_Tick(object sender, EventArgs e)
{
if (this.X != Cursor.Position.X ||
this.Y != Cursor.Position.Y)
{
this.Form1_Load(this, e);
}
else
{
this.Text = (Convert.ToInt16(this.Text)+1).ToString();
}
}
private void Form1_Load(object sender, EventArgs e)
{
this.Text = "0";
this.X = Cursor.Position.X;
this.Y = Cursor.Position.Y;
}
Other forms will not answer
If the form2 is open. The above code does not work.