Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在WPF中设置鼠标位置_Wpf_Mouse_Position - Fatal编程技术网

如何在WPF中设置鼠标位置

如何在WPF中设置鼠标位置,wpf,mouse,position,Wpf,Mouse,Position,实际上,有一种方法在 我想在自定义控件中为光标定义一个可移动区域。 使用此本机函数会使光标闪烁 是否有其他方法可以设置鼠标位置而不引起闪烁?也许您可以从非托管模式中获益 [System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SetCursorPos")] [return: System.Runtime.InteropServices.MarshalAsAttribute(System.R

实际上,有一种方法在

我想在自定义控件中为光标定义一个可移动区域。 使用此本机函数会使光标闪烁


是否有其他方法可以设置鼠标位置而不引起闪烁?

也许您可以从非托管模式中获益

[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);