Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/313.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
C# 将Mouse.OverrideCursor设置为拖动光标_C#_.net_Wpf_Xaml - Fatal编程技术网

C# 将Mouse.OverrideCursor设置为拖动光标

C# 将Mouse.OverrideCursor设置为拖动光标,c#,.net,wpf,xaml,C#,.net,Wpf,Xaml,我想将覆盖光标设置为拖动项时出现的光标,但是它在游标枚举中不存在,并且我无法找到通过反射访问它的可靠方法 以下是我尝试过的方法之一: Assembly assembly = Assembly.GetExecutingAssembly(); var cursorStream = assembly.GetManifestResourceStream("SimplestDragDrop.DDIcon.cur"); var cursor = new Cursor(cursorStream); Mouse

我想将覆盖光标设置为拖动项时出现的光标,但是它在游标枚举中不存在,并且我无法找到通过反射访问它的可靠方法

以下是我尝试过的方法之一:

Assembly assembly = Assembly.GetExecutingAssembly();
var cursorStream = assembly.GetManifestResourceStream("SimplestDragDrop.DDIcon.cur");
var cursor = new Cursor(cursorStream);
Mouse.OverrideCursor = cursor;

您可能想了解更多关于wpf拖放@Steve的信息。我很感谢您的介绍,但是,我在这里并没有执行标准的拖放操作。我只想访问拖动光标。只需找到作为png的光标图标,并将其添加到项目资源中。您可以将其用作自定义光标。这种方法的唯一一点是,当您使用windows optics主题时,光标将保持原样。您可能想了解更多关于wpf拖放@Steve的信息。我感谢您的参考,但是,我在这里没有执行标准的拖放操作。我只想访问拖动光标。只需找到作为png的光标图标,并将其添加到项目资源中。您可以将其用作自定义光标。这种方法的唯一优点是,当您使用windows光学系统的主题时,光标将保持原样。