0

I need text with different colors (red and green) on a single line.

I've looked at TRichEdit, but it doesn't seem to allow changing text properties within a line. Which component would allow that ?

muchos
  • 41
  • 5
  • 3
    TRichEdit DOES allow changing text properties char by char. – MundoPeter Apr 06 '23 at 14:28
  • 1
    You have to *select* the desired char(s) first (`SelStart` and `SelLength` properties) and then use the `SelAttributes` property to format the selected text with desired characteristics, like color. Rinse and repeat as needed. – Remy Lebeau Apr 06 '23 at 14:36
  • From a project of mine with AdvRichEditor t: TTextElement; t := AdvrichEditor.AddText('Description', taCenter); t.Color := clYellow; t.FontSize := 12; t.FontStyle := [fsBold, fsUnderline]; – Shlomo Abuisak Apr 07 '23 at 06:39

0 Answers0