custom cursor in UWP

BitSmithy 2,041 Reputation points
2023-11-08T13:49:34.3166667+00:00

Hello,

I want to use custom cursor types (images) in my UWP app.

I found in net if there are two solutions:

  1. Using c++ resource file
  2. Using Community Toolkit

I dont like these solutions.

Is there a solution where I can do this task using only pure UWP and C#?

Maybe there is a solution where I can use cursor file, ex: mycursor.cur.

I want to have many customs cursors in my project.

Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Roy Li - MSFT 33,001 Reputation points Microsoft Vendor
    2023-11-09T02:32:43.3033333+00:00

    Hello,

    Welcome to Microsoft Q&A!

    Is there a solution where I can do this task using only pure UWP and C#?

    If you want to change the cursor with custom image, adding the c++ resource file and using CoreCursorType.Custom is correct way to do it. Currently, there is no other ways that you could set the cursor with custom image via API directly.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.