how to change the pointer cursor in winUI?

mc 5,041 Reputation points
2023-09-21T06:31:27.35+00:00

I am using winui3

how to change the pointer cursor.

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
804 questions
{count} votes

Accepted answer
  1. Jeanine Zhang-MSFT 10,281 Reputation points Microsoft Vendor
    2023-09-21T06:56:20.2433333+00:00

    Hello,

    Welcome to Microsoft Q&A!

    You could try to use UIElement.ProtectedCursor Property.

    You need to subclass the UI element that you want the cursor to be changed in, and then add a method that sets a ProtectedCursor property.

    For more details you could refer to the thread: https://github.com/microsoft/WindowsAppSDK/discussions/1816

    Thank you.

    Jeanine


    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 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.