currently i have a textblock placed in a scroll viewer control. How do i make the textblock read only?
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.
To prevent users from modifying the contents of a TextBox control, set the IsReadOnly attribute to true.
TextBlock is not editable.
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?
BinaryTox1n answered your question, but if you need the text to be selectable see the previous StackOverflow question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With