Click here to Skip to main content
Rate this: bad
good
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 4:09am
Comments
Karl Sanford at 27-Aug-11 10:42am
   
What type of project is this? WPF, Winforms, ASP.NET?
ColdCrush at 27-Aug-11 10:49am
   
its a WindowsFormApplication in Visual C#.Net
BillWoodruff at 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
good
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!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

YOUR FIND THIS
THIS IS BLOODED CODE LINK
 
http://www.cnblogs.com/xe2011/p/3780793.html
http://files.cnblogs.com/xe2011/WindowsFormsApplication_LimitRichTextBoxInput.rar
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 504
1 Gihan Liyanage 298
2 RyanDev 250
3 Sergey Alexandrovich Kryukov 223
4 Richard Deeming 195
0 Sergey Alexandrovich Kryukov 8,906
1 OriginalGriff 7,771
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 11 Jun 2014
Copyright © CodeProject, 1999-2014
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