0

I read this post: How to simulate Mouse Click in C#?.

It was helpful but I could not click the point I want. I think the x and y variables are corresponding to screen coordinates. I wanted to set the values according to my program(form).

Community
  • 1
  • 1
user983924
  • 395
  • 2
  • 10
  • 23

2 Answers2

1

to transform your coordinates check following function available in your Form

public class Control
{
    public Point PointToScreen(Point p);
}

to read/write screen coordinates you may use

public sealed class Cursor
{
    public static Point Position { get; set; }
}
rudolf_franek
  • 1,795
  • 3
  • 28
  • 41
0

Are you just needing to click a button? You can call buttonName.Click

Also, you could add in a label and have onMouseMove update the X,Y. This may help you get better coordinates

Brent
  • 578
  • 3
  • 12