Click here to Skip to main content
15,885,868 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello im working on a program that displays a gui with all the keyboard keys and a rich text box in C# windoes forms,
the user is supposed to input a text to the rich text box and then press with the mouse (for exmple) the A button
and all the a the a chars will be in green color,but i dont know how can i color those specific car charcters.

any help would be more than appreciated!
Posted
Updated 18-Jul-12 14:41pm
v2

1 solution

You will need to learn some RTF specifications. Then iterate the input text and set opening and closing rtf tags to set the color. Also, keep in mind that if you have added the rtf tags you will need to verify if you have already added a tag so you aren't adding the same tags around specific characters multiple times.

http://msdn.microsoft.com/en-us/library/aa140277(v=office.10)[^]

If there is another way I am not aware of it. I haven't used Richtext box in a couple years so maybe there is another way???
 
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