Board index » delphi » help with assigning color to string in richedit

help with assigning color to string in richedit

I develping an HTML editor and need to know how to
assign a color to a string that will be inserted into a
richedit.

This is the code I use.
procedure TForm1.ToolButton85Click(Sender: TObject);
var text: String;
begin
text := ('<HTML></HTML>');
RichEdit().SelText := text;
end;

I need some simple code to show me
how to do this.

 

Re:help with assigning color to string in richedit


Quote
"Jack Routledge" <chld...@netins.net> wrote in message

news:971qpu$3nh$1@ins21.netins.net...

Quote
> I develping an HTML editor and need to know how to
> assign a color to a string that will be inserted into a
> richedit.

> This is the code I use.
> procedure TForm1.ToolButton85Click(Sender: TObject);
> var text: String;
> begin
> text := ('<HTML></HTML>');
> RichEdit().SelText := text;

RichEdit.SelAttributes.Color := aTColor;

Re:help with assigning color to string in richedit


Quote
Jack Routledge <chld...@netins.net> wrote in message

news:971qpu$3nh$1@ins21.netins.net...

Quote
> I develping an HTML editor and need to know how to
> assign a color to a string that will be inserted into a
> richedit.

i might suggest you not to develop a HTML editor yourself. Use an existing
one - SynEdit. It has support for HTML syntax, many people is working on it
and it's free.

http://synedit.sourceforge.net

--
Smola
--
"And once again, the day is saved"
(http://supersmola.tripod.com/index.htm)

Re:help with assigning color to string in richedit


So why don't you put:
Richedit().SelAttributes.Color:=clRed;   {to make it red}

?

Jack Routledge schrieb:

Quote
> I develping an HTML editor and need to know how to
> assign a color to a string that will be inserted into a
> richedit.

> This is the code I use.
> procedure TForm1.ToolButton85Click(Sender: TObject);
> var text: String;
> begin
> text := ('<HTML></HTML>');
> RichEdit().SelText := text;
> end;

> I need some simple code to show me
> how to do this.

Other Threads