Hello guys. I've found a new problem. I'm using an string array ( unidimensional: Important[] ), and a RichtextBox Text.

Let's say, my rich text box is: 1 january 1852 - In this year, Eugene-Antole Demarcay was born.

Ok, i want like Eugene-Antole Demarcay to have it's color red, and I did:

for (int i = 0; i < Important.Length; i++)
            {
                richTextBox1.Find(Important[i], RichTextBoxFinds.MatchCase);
                richTextBox1.SelectionColor = Color.Red;
            }
      richTextBox1.SelectionStart = 0;

Ok, and my text looks now: 1 january 1852 - In this year, Eugene-Antole Demarcay was born., but i have a new problem, look at photo: http://img191.imageshack.us/img191/2704/phototb.png

That blue background color, i don't want it ...

Recommended Answers

All 5 Replies

Do you set the background color to blue?

no lol, try to select my text and you'll see how the background color it's changing ....

Assuming that it is the Dark Blue that you do not want then it is because you are not resetting the SelectionLength property to zero when you reset the SelectionStart.
SelectionLength is still set to the length of the newly Red text and therefore the selection highlight is shown on the first 22 characters.

Thanks

No Problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.