Answers for "how to get mouse position c#"

C#
2

c# get mouse position

using System.Runtime.InteropServices;

[DllImport("user32.dll")]
    static extern bool SetCursorPos(int X, int Y);

    [DllImport("user32.dll")]
    public static extern bool GetCursorPos(out Point pos);


	Point point = new Point();
	GetCursorPos(out point);

	SetCursorPos(1,1);
Posted by: Guest on September-06-2021
0

how to get mouse position c#

//WARNING: not just limited to your form, but to the whole sceen :)

//Getting the mouse position and storing it as a point
Point f = new Point((Size)MousePosition);
Posted by: Guest on March-27-2021

C# Answers by Framework

Browse Popular Code Answers by Language