0

I want to change my mouse pointer to an custom cursor in my application.

So when my application starts, i want the custom cursor, and when it stops i want it gone.

How to do this in c# behind the code in wpf?

Letoir
  • 395
  • 7
  • 15

2 Answers2

2

You Can implement it this way. Simple steps. Just have to give the .cur image path and bind it with Cursor.

<Window>
   <Window.Resources>
       <Cursor x:Key="OpenHandCursor">C:\Users\Images\InvalidS.cur\ </Cursor>
   </Window.Resources>
</Window>

<StackPanel oriential="Horizontal" Cursor="{StaticResource OpenHandCursor}"> ............................... </StackPanel>

Thank You

Joy Fernandes
  • 303
  • 3
  • 16
1

You can not have the cursor changed for the whole operating system environment, only the WPF window.

Follow this post on how to set a custom cursor

Community
  • 1
  • 1
Sandeep Bansal
  • 6,280
  • 17
  • 84
  • 126