Page 1 of 1

How to create line with different parts (bold, coloured etc.) without AddText?

Posted: Thu Aug 23, 2018 7:35 am
by klinikaxp
I used it to generate line, which has some parts in different format, for example:

(R : TCustomRichView)

with R do
begin
AddText ('This is ', RED_NORMAL_STYLE);
AddText ('VERY IMPORTANT NUMBER', BOLD_STYLE);
AddTextNL (' and here is the rest of sentence.', NORMAL_STYLE, 0,0);
end;

The effect was following:

This is VERY IMPORTANT NUMBER and here is the rest of sentence.

In version 17.5 AddText method is not available.
How can I create the line/paragraph containing different formatting?

Re: How to create line with different parts (bold, coloured etc.) without AddText?

Posted: Fri Aug 24, 2018 9:51 pm
by Sergey Tkachenko
AddTextNL ('This is ', RED_NORMAL_STYLE, 0, 0);
AddTextNL ('VERY IMPORTANT NUMBER', BOLD_STYLE, -1, 0);
AddTextNL (' and here is the rest of sentence.', NORMAL_STYLE, -1, 0);