How do I change the mouse cursor?

Changing the Cursor Universally

To change the mouse cursor universally (so it's changed regardless of the user interface element it's positioned over) you can set the Mouse.OverrideCursor property.

For example, the following code sets the cursor to a wait cursor:

Mouse.OverrideCursor = Cursors.Wait;

This code returns the cursor back to its default:

Mouse.OverrideCursor = null;

mmWindow.Show() and ShowDialog() call the mmUIHelper.DisplayWaitCursor(). mmBaseWindow_ContentRendered() automatically clears the wait cursor for you.

Changing the Cursor for a specific User Interface Element

You can change the mouse cursor for a specific user interface element by setting the Cursor property of the user interface element. This changes the cursor whenever the user positions the mouse pointer over the specified element.

For example, the following code sets the cursor to a wait cursor:

this.Cursor = Cursors.Wait;

This code sets the cursor back to an arrow:

this.Cursor = Cursors.Arrow;

mmBaseWindow has a DisplayWaitCursor() method that sets the Window's Cursor property to Cursors.Wait, and a DisplayDefaultCursor() method that sets the Window's Cursor property to Cursors.Arrow. You can override these methods to display a different wait or default cursor.


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 04/26/18
Comment or report problem with topic