custom cursor in metro app

后端 未结 1 686
名媛妹妹
名媛妹妹 2021-01-07 04:36

I am developing a paint like application. I want to change cursor at some instance. So, how can I use the custom cursor in metro app ?

I have found this



        
相关标签:
1条回答
  • 2021-01-07 05:30

    The basic route to doing this:

    Create your custom cursor and package it in a .res using a C++ Metro DLL Take a note of your resource id by peeking into the resource.h file in the C++ project In my project the resource number was 101 and I didn't adjust. Add the .res to a CSharp XAML Metro project Open your .csproj using a text editor Inside the first property group add a section that points to your .res file Switch out the cursor to the custom cursor using the function call you referenced, and the resource number you found by peeking at resource.h. Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Custom, 101);

    I realize this is a lot. I posted a detailed step by step walk through on my blog at http://blogs.msdn.com/b/devfish/archive/2012/08/02/customcursors-in-windows-8-csharp-metro-applications.aspx . Hope this helps.

    0 讨论(0)
提交回复
热议问题