Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/260.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# 自定义光标在移动前闪烁为默认值_C#_Wpf_Flicker_Custom Cursor - Fatal编程技术网

C# 自定义光标在移动前闪烁为默认值

C# 自定义光标在移动前闪烁为默认值,c#,wpf,flicker,custom-cursor,C#,Wpf,Flicker,Custom Cursor,我正在做一个WPF应用程序,我正在尝试将默认的鼠标光标更改为我创建的鼠标光标。我有一个.cur文件,一切正常,直到我显示一个弹出窗口,鼠标在移动前再次恢复默认。移动鼠标后,自定义光标将返回 我尝试通过pathabsolute、relative和stream使用游标,将游标作为资源、嵌入式资源和/或内容。我还试着从app.xaml.cs、mainWindow.xaml.cs等处调用它。。。问题是,不管我把它放在哪里,它都不会消除闪烁 下面是我加载光标的一些代码: System.Window

我正在做一个WPF应用程序,我正在尝试将默认的鼠标光标更改为我创建的鼠标光标。我有一个.cur文件,一切正常,直到我显示一个弹出窗口,鼠标在移动前再次恢复默认。移动鼠标后,自定义光标将返回

我尝试通过pathabsolute、relative和stream使用游标,将游标作为资源、嵌入式资源和/或内容。我还试着从app.xaml.cs、mainWindow.xaml.cs等处调用它。。。问题是,不管我把它放在哪里,它都不会消除闪烁

下面是我加载光标的一些代码:

    System.Windows.Resources.StreamResourceInfo sri = System.Windows.Application.GetResourceStream(new Uri("Kulamity;component/media/mouseCursor.cur", UriKind.Relative));
    System.Windows.Input.Cursor customCursor = new System.Windows.Input.Cursor(sri.Stream);
    this.Cursor = customCursor;
以及:


我能做些什么来解决这个问题?可能是什么问题

我还应该提到,我的应用程序使用MVC模式。
        var fullPath2 = System.IO.Path.GetFullPath("../../mouseCursor3.cur");
        Mouse.OverrideCursor = new Cursor(fullPath2);