This could be a way to do it:
void __fastcall TForm1::RichEdit1Change(TObject *Sender)
{
::SendMessage(RichEdit1->Handle, WM_SETREDRAW, false, 0);
int sp = RichEdit1->SelStart;
for(int i=0;i<RichEdit1->Text.Length();i++)
{
if(RichEdit1->Text[i+1] >= 'A' && RichEdit1->Text[i+1] <= 'Z') // capital letters
{
RichEdit1->SelStart = i;
RichEdit1->SelLength = 1;
RichEdit1->SelAttributes->Color = clBlue;
RichEdit1->SelAttributes->Style = RichEdit1->SelAttributes->Style << fsBold;
}
else
{
RichEdit1->SelStart = i;
RichEdit1->SelLength = 1;
RichEdit1->SelAttributes->Color = clBlack;
RichEdit1->SelAttributes->Style = RichEdit1->SelAttributes->Style >> fsBold;
}
}
RichEdit1->SelStart = sp;
::SendMessage(RichEdit1->Handle, WM_SETREDRAW, true, 0);
RichEdit1->Refresh();
RichEdit1->Repaint();
}
I know that code is ... well, lame, but, meh, I don't care :D
What it does is:
1. disables drawing
2. it goes through all elements in RichEdit, changing capital letters to bold and blue
3. enables drawing
Should be pretty easy to search for particular strings in there and change them.
I hope it helps :)