Board index » delphi » highlight Html tags in a RichEdit

highlight Html tags in a RichEdit

Hi Group,

My question: How to make Html tags in my TRichedit an other color ?
This is how I'll have it: (...bad English don't you think.... sorry)

<html>, <body>: Red color
<a href="...."> .... = Green color
other text: Black color.

How to make this ?
Please mail an good-working source, the sources on the internet
are not so good I think.

Regards, Pieter Barendrecht
www.pjbsoftware.tk (newer version)

 

Re:highlight Html tags in a RichEdit


Quote
Pieter wrote:
> Hi Group,

> My question: How to make Html tags in my TRichedit an other color ?
> This is how I'll have it: (...bad English don't you think.... sorry)

> <html>, <body>: Red color
> <a href="...."> .... = Green color
> other text: Black color.

> How to make this ?
> Please mail an good-working source, the sources on the internet
> are not so good I think.

> Regards, Pieter Barendrecht
> www.pjbsoftware.tk (newer version)

Set the selection to the word you want to colorize with the SelStart en
SelLength properties. After that change the color with SelAttributes.Color;

Example:

RichEdit1.SelStart:=10;
RichEdit1.SelLength:=10;
RIchEdit1.SelAttributes.Color:=clRed;

--
www.zenobits.com

Other Threads