How can I make the mouse move along a certain axis while the user holds the left button down? I would like the user to be able to move the mouse along the x-axis, while any movement along the y-axis would be βcanceledβ.
thanks eden
Check this out: http://social.msdn.microsoft.com/Forums/en/wpf/thread/9b07abce-bb32-4cd1-9ae5-d34973d5cc95
From the link:
public partial class MouseOperations { [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursorPos")] [return:System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] public static extern bool SetCursorPos(int X, int Y); }
You will need to call the method from the Mouse.MouseMove event handler .
MouseOperations.SetCursorPos(xAxisPosition,0);
Source: https://habr.com/ru/post/1750637/More articles:How to write INT64 in CString - c ++Escaping from C #, a little puzzled - c #Column of time sqlite3 - sql0 to the number - ruby ββ| fooobar.comasp.net mvc - How to quickly and efficiently create fake test objects - unit-testinganimation to move: position change visualization - jqueryUsing WCF RIA services where the data source is not a classic (relational) database - .netDebugging only with .exe - debuggingUsing an encrypted web.config file - asp.netHow to save a search result? - javascriptAll Articles