2

In a C# UWP application I use Window.Current.CoreWindow.PointerCursor = null to try and set the mouse cursor to stop rendering which used to work a few windows 10 updates ago but recently the cursor no longer disappears.

What is the correct method to remove the rendering of the cursor?

Also I have tried running the code both in and outside a Window.Current.CoreWindow.Dispatcher.RunAsync method.

And I have verified that Window.Current.CoreWindow.PointerCursor is null after I set it.

Daniel Armstrong
  • 829
  • 9
  • 22
  • When I set `null` to `Window.Current.CoreWindow.PointerCursor` that can make the cursor disappear. Does your app is a UWP app or it is a game app? – Jayden Nov 02 '17 at 08:24
  • What do you mean by is it a UWP or Game app? It is a UWP title that is a game, but I have not marked it as a game in anyway as far as I am aware. – Daniel Armstrong Nov 03 '17 at 02:07

1 Answers1

2

You need to write following code in App constructor

this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested;
Ipsit Gaur
  • 2,872
  • 1
  • 23
  • 38
  • 1
    Sadly this has no effect. Perhaps I am missing something else? The mouse goes away for a little while (with or without the above code) but returns whenever I move or click the mouse... – Daniel Armstrong Oct 19 '17 at 10:27
  • How can I find what is the current cursor type in UWP, C#? – Mahesh Dec 05 '17 at 13:11