Tag: cursor

以编程方式移动鼠标光标

首先,我在http://swigartconsulting.blogs.com/tech_blender/2005/08/how_to_move_the.html找到了此代码: public class Win32 { [DllImport(“User32.Dll”)] public static extern long SetCursorPos(int x, int y); [DllImport(“User32.Dll”)] public static extern bool ClientToScreen(IntPtr hWnd, ref POINT point); [StructLayout(LayoutKind.Sequential)] public struct POINT { public int x; public int y; } } 将以下代码粘贴到按钮的click eventhandler中: Win32.POINT p = new Win32.POINT(); px = button1.Left + (button1.Width / 2); py = button1.Top + […]