Quantcast
Channel: How to Highlight Text
Viewing all articles
Browse latest Browse all 12

How to Highlight Text

$
0
0

Here's another version using a Lambda:

For Each word As String In h_words
	Array.ForEach(Regex.Matches(RichTextBox1.Text, word, RegexOptions.IgnoreCase).Cast(Of Match).ToArray, _
				Sub(x) RichTextBox1.Select(x.Index, x.Length))
	RichTextBox1.SelectionColor = Color.Red
Next

Cheers!
~Ace


If a post helps you in any way or solves your particular issue, please remember to use thePropose As Answer option or Vote As Helpful
Visit the Forum: TechLifeForum


Viewing all articles
Browse latest Browse all 12

Trending Articles



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