How can I get one specific line to be bold in a RichEdit?
How to make a single line bold in a RichEdit?
Formatting in a rich edit control is done like this:
- Select the text to which formatting is to be applied.
- 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.
© 2022 - 2024 — McMap. All rights reserved.
SelAttributes
and write a new line. Or, select an already existing line and setSelAttributes
. – Franek