Richtext box aplhabets coloring problem
If I enter on richtextbox any alphabets its show on different color, suppose if we enter 'A' or 'a' it show like green color and if we enter '1' it show like red color.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sanjay KumarRank #561 · 4.3K reputationPosted Dec 3, 2013, 2:12 AM EST
http://stackoverflow.com/questions/13220856/how-to-use-multi-color-in-richtextbox
http://www.dotnetperls.com/richtextbox
http://www.codeproject.com/Articles/37668/Multiple-Colored-Texts-in-RichTextBox-using-C
Dharmendra Singh178 reputationPosted Dec 3, 2013, 7:26 PM EST
my code is
internal void HighlightPhrase(RichTextBox box, string word, Color color)
{
box.SuspendLayout();
int pos = box.SelectionStart;
string s = box.Text;
int ix = 0;
while (true)
{
int jx = s.IndexOf(phrase, ix, StringComparison.CurrentCultureIgnoreCase);
if (jx < 0) break;
box.SelectionStart = jx;
box.SelectionLength = phrase.Length + 2;
box.SelectionColor = color;
ix = jx + 1;
}
box.SelectionStart = pos;
box.SelectionLength = 0;
box.ResumeLayout();
}