making textblock readonly

白昼怎懂夜的黑 提交于 2019-12-10 12:29:17

问题


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


回答1:


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?




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/5073244/making-textblock-readonly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!