tags:

views:

44

answers:

1

I want to change the color of text written in richtextbox after curly braces({..}).i.e. if I write some code within the curly brackets then it should be displayed into red color. Plz suggest me code for this.

A: 

So this seems to be something similar to syntax highlighting.
You can see here for some tips

Basically what you need to do is use RichTextBox's TextChanged Event, then reg expressions to find interesting part of text, select it and color...

Here is also interesting post talking about that

Maciej
I don't want that color should be change on selection of text rather I want to change the color of text which is written within curly brackets. Can you plz suggest me proper code for this?
Arti
Have you read posts I mentioned in my answer? There is all you need to make you rtb colouring during entering text. All you need is find substring you want to color (using eg regex or string's substring, indexOf method)
Maciej