Link to home
Start Free TrialLog in
Avatar of volavy
volavy

asked on

Different line colors in a Memo/RichEdit

How do I write with different colors in a Memo/Richedit? I would like to use it in the following way:

var
 str : string;
begin
  if pos('g', str) then Memo1.Lines.Add( --something green)
  if pos('r', str) then Memo1.Lines.Add( --something red)
end;

Regards

/Peter
ASKER CERTIFIED SOLUTION
Avatar of Hamilton
Hamilton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Epsylon
Epsylon

In TRichEdit:

  RichEdit1.SelAttributes.Color := clGreen;
  RichEdit1.Lines.Add('I am green!');
  RichEdit1.SelAttributes.Color := clRed;
  RichEdit1.Lines.Add('I am red!');


Don't think you can use colors in a memo in a proper way.


Regards,

Epsylon.