How can I change the color of certain characters in a TRichEdit? [closed]
I'm doing a Delphi 7 project where I have to let a user enter in a number (Layers going down) to build a Christmas tree, but I also need to display the output as *
(stars). I am having a problem editing a certain line of stars in the TRichEdit to make the color change randomly just like a real Christmas tree shines.
Formatting in rich edit controls works by first selecting text, then applying formatting to that selection.
Select the text with the SelStart
and SelLength
properties.
Apply formatting with the SelAttributes
property, for example SelAttributes.Color := clRed;
.
精彩评论