Don't change cursor over TextBox

KrisTrip picture KrisTrip · Dec 12, 2011 · Viewed 8.3k times · Source

I am trying to make a TextBox look like a TextBlock to the user (it is in a treeview that I want to allow renaming in). I was able to do this by applying a style to set the border and background to transparent and the IsReadOnly property to true. My only problem is that the mouse cursor still changes from the pointer style to the editing (caret) style. Is there an easy way to disable this (preferably in xaml)?

Answer

Rachel picture Rachel · Dec 12, 2011

Sure, just set the TextBox's Cursor property to Arrow

<TextBox Cursor="Arrow" />