Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

making textblock readonly

Tags:

currently i have a textblock placed in a scroll viewer control. How do i make the textblock read only?

like image 590
jeremychan Avatar asked Feb 22 '11 01:02

jeremychan


People also ask

How do I make a TextBox not editable?

Set the TextBox control's ReadOnly property to true . With the property set to true , users can still scroll and highlight text in a text box without allowing changes.

How do you make a TextBox non editable in WPF?

To prevent users from modifying the contents of a TextBox control, set the IsReadOnly attribute to true.

Is Textblock editable?

TextBlock is not editable.


2 Answers

Textblocks are already readonly. They are intended to display a small amount of flow text. Perhaps you thought you were dealing with a TextBox instead?

like image 143
BinaryTox1n Avatar answered Nov 12 '22 16:11

BinaryTox1n


BinaryTox1n answered your question, but if you need the text to be selectable see the previous StackOverflow question.

like image 28
kevindaub Avatar answered Nov 12 '22 15:11

kevindaub