WPF RichTextBox - 禁用编辑但保留光标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14029743/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 06:46:06 来源:igfitidea点击:
WPF RichTextBox - disable editing but keep the cursor
提问by Lullaby
I have a richtextbox. I need the have the possibility to disable the editing, but I want to keep the cursor: to move between words, to select some words using the keyboard,etc.
我有一个富文本框。我需要有可能禁用编辑,但我想保留光标:在单词之间移动,使用键盘选择一些单词等。
Thanks
谢谢
回答by Paul Michaels
Try the IsReadOnlyproperty - this should do what you want
试试这个IsReadOnly属性 - 这应该做你想做的

