Click here to Skip to main content
15,885,043 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
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 ?

YOUR FIND THIS
THIS IS BLOODED CODE LINK

http://www.cnblogs.com/xe2011/p/3780793.html
http://files.cnblogs.com/xe2011/WindowsFormsApplication_LimitRichTextBoxInput.rar
 
Share this answer
 
v2
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!
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900