Monday, May 20, 2013

#823 – Setting a Cursor from XAML

Inline image 2

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.


QR: Inline image 1