tags:

views:

20

answers:

1

I have a richtextbox control in my WPF 4.0 application. Now suppose I have a text like

"hello how [space][space] r u? [space][space] I am fine"

As can be noticed that there are two gaps between how and r as well as between ? and I.

When this will happen then the portion will be highlighted with green e.g. how ..r and from ? to I will be highlighted with green color.

i.e. if the space between two words are more than 2 then that will be highlighted with green.

Is it possible to do in WPF RichTextbox control? If so, please help me in writing so. As of now what I have done is that I have only able to find out the distance of spaces between two words.

Note:~ [Space] means the white spaces. Since the gap was not prominent(as it was not coming in the editor), that's the reason I made it like so.

Thanks

WPF4.0/ C#4.0

+1  A: 

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/7c9a622a-4e3b-451e-bc4c-ab9d011447e0

Here is a progressive scenario featuring RichTextBox highlighting multiple ranges, it may lead you on the right path.

He ends up getting it to work, but you will have to modify it to recognize white space perhaps.

halfevil