Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

richTextBox Questions

$
0
0

Hello guys. I have a simple form with a docked richTextBox. I have an text which contains 2 phrases and 2 words Hello. I try to select the words "Hello" and to give them a red color, but he selects only first hello. Here is my code:

            richTextBox1.SelectAll();
            richTextBox1.SelectionAlignment = HorizontalAlignment.Center;
            richTextBox1.ZoomFactor = 3.0f;
            richTextBox1.Select(0, 0);
            richTextBox1.Find("Hello", RichTextBoxFinds.MatchCase);
            richTextBox1.SelectionColor = Color.Red;
            richTextBox1.Select(0, 0);


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>