Click here to Skip to main content
11,928,569 members (53,996 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
Hello, i want to have a RichTextBox where a text is loaded inside.
But the User must have the chance to change only a part of the TextBox is this possible?
Posted 27-Aug-11 5:09am
Karl Sanford 27-Aug-11 10:42am
What type of project is this? WPF, Winforms, ASP.NET?
ColdCrush 27-Aug-11 10:49am
its a WindowsFormApplication in Visual C#.Net
BillWoodruff 28-Aug-11 1:40am
Can you describe a bit more fully the spatial relationship of the text you do not wish the user to edit and the text you do wish to allow to be edited: are they "mixed together" in one sentence, or one paragraph, or are they contained in completely different areas ?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There is no simple way to do what you have described. You may be able to get some ideas from this CP article:
Syntax highlighting textbox written in C#[^]

While this article is for syntax highlighting, the concept isn't too much different from what you have described. Essentially, you need to tokenize the text and perform some action on it based on the text. In this articles case, the action is to highlight or not highlight, and in your case your action is to edit or not edit. (You may even be able to use the synatx highlighting idea to identify those areas that can be edited)

If you get this working, I think it would make a great article!
Rate this: bad
Please Sign up or sign in to vote.

Solution 4


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 26 Nov 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100