cristh
asked on
Text Color in TMEMO or other component
How to set each word in TMEMO to many color font in one line ? I can set to one color only. How do I or have any component that I can use more ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
aubs is right, your need require a rich edit component.
If you are using D4 or less then this is the code using a TRichedit component as suggested earlier:
RichEditMemo.Selstart := Length(RichEditMemo.Text);
RichEditMemo.SelAttributes .Color := clBlue;
RichEditMemo.SelText := 'This is the first line in blue'+#10;
RichEditMemo.Selstart := Length(RichEditMemo.Text);
RichEditMemo.SelAttributes .Color := clBlack;
RichEditMemo.SelText := 'This is the second line in black'+#10;
Rob;-)
RichEditMemo.Selstart := Length(RichEditMemo.Text);
RichEditMemo.SelAttributes
RichEditMemo.SelText := 'This is the first line in blue'+#10;
RichEditMemo.Selstart := Length(RichEditMemo.Text);
RichEditMemo.SelAttributes
RichEditMemo.SelText := 'This is the second line in black'+#10;
Rob;-)
If you are using D4 or less then this is the code using a TRichedit component as suggested earlier:
RichEditMemo.Selstart := Length(RichEditMemo.Text);
RichEditMemo.SelAttributes .Color := clBlue;
RichEditMemo.SelText := 'This is the first line in blue'+#10;
RichEditMemo.Selstart := Length(RichEditMemo.Text);
RichEditMemo.SelAttributes .Color := clBlack;
RichEditMemo.SelText := 'This is the second line in black'+#10;
Rob;-)
RichEditMemo.Selstart := Length(RichEditMemo.Text);
RichEditMemo.SelAttributes
RichEditMemo.SelText := 'This is the first line in blue'+#10;
RichEditMemo.Selstart := Length(RichEditMemo.Text);
RichEditMemo.SelAttributes
RichEditMemo.SelText := 'This is the second line in black'+#10;
Rob;-)
Whay don't use TMemoColor ?
I use it and is very nice .
Regards,
Nick aka ginsonic
I use it and is very nice .
Regards,
Nick aka ginsonic
This is the download address :
http://www.balticsolutions.com/
It's freeware .
Pay only if you wish the source code .
Nick
http://www.balticsolutions.com/
It's freeware .
Pay only if you wish the source code .
Nick
ASKER
Thank aubs and I accept your comment as answer. Thank you all for your comment :)