c# - How to move cursor in windows form application? -
i'm writing application need move cursor programmatically. i've tried writing:
cursor.position = new point(50, 50);
but doesn't work. im writing windows form application in c#.
i hope can me :) in advance :)
assuming want button click:
first add interopservices namespace:
using system.runtime.interopservices;
then create button click event
[dllimport("user32.dll")] public static extern long setcursorpos(int x, int y); private void button1_click(object sender, eventargs e) { setcursorpos(50,50); }
take @ this:
[https://stackoverflow.com/questions/647236/moving-mouse-cursor-programmatically][1]
Comments
Post a Comment