(X) Hide this SilverlightShow next training events: Getting started with the Silverlight 5 Beta - a free 1 hour webinar on May 11th, by Michael Crump. Join at 10 am PST.
XNA for Windows Phone 7 - a 3 day training by MCC Peter Kuhn. June 1-3, 9 am - 1.30 pm PST. Sign up early-bird for $199.
Skip Navigation LinksHome / Tips / View Tip

Tip: How to change the cursor of a control?

+ Add to SilverlightShow Favorites
0 comments   /   posted by Denislav Savkov on Sep 02, 2008
(0 votes)
Tags: Cursor , Denislav Savkov
Categories: Controls and UI

Control's cursors can be changed very easily in Silverlight. All controls that derive from System.Windows.FrameworkElement have Cursor property that can be set from Xaml or the code behind. The value for that property should be one of the predefined cursors such as Hand, Wait, Arrow, IBeam etc. declared in the static class System.Windows.Input.Cursors.

Xaml

 <Button x:Name="pushMeButton" Content="Push me now!" Cursor="Hand"></Button>
 
C#
 pushMeButton.Cursor = Cursors.Hand;
That's it!
Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 2 and 1 and type the answer here: