#823 – Setting a Cursor from XAML

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.

        <Label Content="I'm just a label, you know?"
        <Label Content="I'm waiting and waiting"



About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #823 – Setting a Cursor from XAML

  1. Pingback: Dew Drop – May 20, 2013 (#1,550) | Alvin Ashcraft's Morning Dew

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: