How Do You Change the Cursor of a WPF App?

Changing the cursor of a WPF app is pretty simple. You can do it through procedural code as follows:

this.Cursor = Cursors.None;

There are several built in cursors such as a pen, cross, scroll, etc. You can also use a custom cursor as follows:

this.Cursor = new Cursor("CustomCursorImage.jpg"); 
Because Cursor is a dependency property, it can also be used in XAML. Here are two  examples on how to use custom cursors via XAML:

<Button Content="Wait" Cursor="Wait"/><Button Content="CustomCursorImage.jpg"/>

Advertisement

2 Responses to “How Do You Change the Cursor of a WPF App?”

  1. Renuka Says:

    This does not work with WPF.
    Please sugust some way

  2. wpfguiblog Says:

    Can you be a little more specific? Why isn’t this working?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.