In a Windows Forms application I would like to edit plain text (formatting is currently not required) but keep some parts of the text non-editable. E.g. start with "ABC" to which the user may append or prepend additional text or delete "ABC" entirely but always keep "ABC" as a non-editable atom.
My first thought was to use a RichTextBox and add an RTF field ({\field...}
) but it seems like RichTextBox does not support fields.
Another approach could be to add the non-editable text as a picture. However, I have not found a way to reliably prevent resizing the image. (Question asked here before: Remove the ability to resize an image pasted into a richtextbox and add an event to that image. C#)
Do you have any suggestions how to get this to work using the fields or pictures? Or any other approach to design the desired behaviour?