4

How can I get one specific line to be bold in a RichEdit?

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
User049
  • 127
  • 1
  • 11

1 Answers1

5

Formatting in a rich edit control is done like this:

  1. Select the text to which formatting is to be applied.
  2. Apply that formatting to the selection.

It goes something like this:

RichEdit1.SelStart := SelectionStart;
RichEdit1.SelLength := SelectionLength;
RichEdit1.SelAttributes.Style := RichEdit1.SelAttributes.Style + [fsBold];

Of course, you have to work out what to use in place of SelectionStart and SelectionLength. Ultimately that comes down to how you are managing the text and I don't think there's enough information in the question to give you a single definitive answer on that topic.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490