简体   繁体   中英

Restrict editing in RichTextBox

I was just wondering if there is a way that we disable editing of a specific word in the System.Window.Controls.RichTextBox? For example, I have "Hello This is a test", and I want to disable users to a edit test(which can be anything). I want to them to change whatever they want, but when they want to click or do anything on "test", it's somehow in a different color like gray(which is easy to do), but not editable.

thanks,

There is no functionality like this built into the RichTextBox. Your best bet is to create a custom control of some type or inherit from the RichTextBox and override methods to add your own functionality.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM