2

I want to know if there is a way to hide cursor in Windows 8 Metro mode. I found this answer, but then I don't know how to obtain the "unique resource id" for the second parameter of the cursor constructor (below).

Window.Current.CoreWindow.PointerCursor = 
                new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Custom, 1);

EDIT: Forgot to mention that I need to handle mouse events normally so the answer below of setting cursor to null will not suffice.

Community
  • 1
  • 1
XiaoChuan Yu
  • 3,951
  • 1
  • 32
  • 44

2 Answers2

2

Set the cursor to a custom cursor but make it just be blank...this allows you to track it like being a normal cursor.

Peter
  • 36
  • 2
2

You can set the PointerCursor object to NULL. As soon as you move over something like a text box, it will reset it back though. So you probably need to handle mouse over events on various controls, to hide it. This all depends on your complete scenario tough.

Also, before setting it to NULL, you can save the value of the property (PointerCursor) and then when you're done, set it back.

Bob Delavan
  • 647
  • 5
  • 6
  • I've already tried that before asking this question. I forgot to say that I need to handle events normally as if you had a cursor. That's why I tried looking into setting a custom transparent cursor. Thanks for the response though. – XiaoChuan Yu Feb 27 '12 at 20:05
  • Sure, glad to help. Can you elaborate though on what you mean by handle mouse events normally? In terms of what I proposed, it would still allow you to handle the events, I was just saying that you would have to additionally handle, for example in a textbox, a "PointerEntered" and then set the cursor again to null or something like that. Are you looking for something more global and persistent where you wouldn't have to handle any future events? – Bob Delavan Feb 27 '12 at 20:22
  • After I set PointerCursor object to NULL, I can only receive pressed and release events but not PointerMoved event (which I need). I think the setting the cursor to null is more of a hack than a solution. – XiaoChuan Yu Feb 28 '12 at 01:24