If you have a custom cursor that your application uses, you can load it at run-time from an external file. But this requires that you distribute the cursor file with your application. To avoid distributing the .cur file, you can embed this file into your project as a resource.

First, add the .cur file to your project and set its Build Action to Resource.

To load the cursor at run-time, you use the Application.GetResourceStream method, which returns a StreamResourceInfo object. You can then use the Stream property of this object to create the cursor. (You’ll need a using statement for the System.Windows.Resources namespace).

You can set a cursor in your application to a cursor that you load from a .cur or .ani file. The constructor for the System.Windows.Input.Cursor class accepts either a filename or a stream. If you use a filename, you should use the full path to your cursor file.

In the example below, we set the cursor for the parent window to one of two different cursors, depending on which button we click.

You can use the Cursors property of a FrameworkElement to set the cursor that the user sees when moving the mouse over that element. This cursor will also be used on descendant elements of the element where you set the cursor.

You can also set the cursor from code. You could just set the Cursor property of an individual element in code. But you can also set the static Mouse.OverrideCursor property, indicating a cursor that should be used throughout the entire application. This will override any Cursor properties of individual elements.

A child FrameworkElement can set a Cursor value that overrides the current Cursor value set by a parent (or ancestor) element. This new Cursor value then applies in the element where it is set and any of its own child elements.

A parent/ancestor FrameworkElement can, however, force all child elements to use a particular cursor, by setting the ForceCursor property to true. This overrides any Cursor property values that the child elements might set.

In the example below, the second Button sets its Cursor property to Hand, but this value is overridden because the parent StackPanel sets the ForceCursor property to true.

A Cursor set on a top-level FrameworkElement will also be used on all elements within the parent element’s logical tree. All lower-level elements will show the same cursor when the user hovers over the element.

You can, however, set a Cursor on a top-level element and then set a different value for Cursor on the lower-level element. The top-level Cursor willbe used for all descendants of the top-level element except for the one that explicitly sets a different cursor.

When you set the Cursor property on a FrameworkElement, the cursor is displayed whenever you move the mouse pointer over that element. This Cursor value will also apply to all descendants of the element.

In the example below, when we set the Cursor in the top-level Window, that cursor is used for all elements contained in the window.

Every FrameworkElement has a Cursor property that you can set to an instance of a System.Windows.Input.Cursor object. Typically, you’ll just set the property to one of the predefined cursors in the System.Windows.Input.Cursors class.

When you set the Cursor property on an element, you’re indicating which cursor should appear when a user moves the mouse over that element.

You can set the Cursor property in XAML or in code. In either case, you can pick from one of the predefined cursors in System.Windows.Input.Cursors. In the image below, Intellisense in Visual Studio shows a list of the available cursors when setting the Cursor property from XAML.

In the example below, we indicate that we want the Wait cursor displayed whenever we hover over the second label.