-3

My code for setting the cursor position on a form:

SetCursorPos(webControl1.PointToClient(Cursor.Position).X, webControl1.PointToClient(Cursor.Position).Y);
            Thread.Sleep(100);
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);

I've got a problem with SetCursor! I don't know how to set the parameters X and Y (I know X,Y before). ex: 75,522 Can anybody help me? regard!

1 Answers1

0

This is just all you need to know I think:

https://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.position%28v=vs.110%29.aspx

If link is down:

    private void MoveCursor()
{
   // Set the Current cursor, move the cursor's Position, 
   // and set its clipping rectangle to the form.  

   this.Cursor = new Cursor(Cursor.Current.Handle);
   Cursor.Position = new Point(Cursor.Position.X - 50, Cursor.Position.Y - 50);
   Cursor.Clip = new Rectangle(this.Location, this.Size);
}

Tip: Try pressing "F1" whenever you need help with a property or something.

christian
  • 110
  • 1
  • 2
  • 15