making textblock readonly
Asked Answered
C

3

21

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

Cattleman answered 22/2, 2011 at 1:48 Comment(0)
W
30

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?

Wien answered 22/2, 2011 at 1:54 Comment(2)
oh ok thanks for your info. because i read from somewhere in order to make textblock text selectable i have to make the textblock read onlyCattleman
If that is what you want, you should use the TextBOX control (I provided a link in my answer) and set IsReadOnly="true" on that new TextBox control. That will do what you want.Wien
C
2

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

Cirrocumulus answered 22/2, 2011 at 1:58 Comment(0)
N
0

Bind the Textblock to a property with only a getter and it will be a readonly textblock.

Nucleotide answered 24/4, 2019 at 7:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.