1

I have array of strings and i want to add an empty line of lesser size between some of them. So i have a code:

  const _n=#13#10;
  //...
  r1.Lines.Clear;
  r1.SelAttributes.Size:=18;
  r1.SelText:='TEST';
  r1.SelAttributes.Size:=6;
  r1.SelText:=_n+'............';
  r1.SelAttributes.Size:=18;
  r1.SelText:=_n+'test1';
  r1.SelAttributes.Size:=6;
  r1.SelText:=_n+' ';
  r1.SelAttributes.Size:=18;
  r1.SelText:=_n+'test2';

and size change works for first line (with dots), but line between test1 and test2 has same size as they (18) somehow =\

Any suggestions?

Markus_13
  • 328
  • 2
  • 14

2 Answers2

0

I found some workaround: it's possible to use tab-symbol in place of space.

So the following code works fine:

  r1.SelAttributes.Size:=18;
  r1.SelText:=_n+'test1';
  r1.SelAttributes.Size:=6;
  r1.SelText:=_n+#9; // <- tab here
  r1.SelAttributes.Size:=18;
  r1.SelText:=_n+'test2';
Markus_13
  • 328
  • 2
  • 14
0

Instead of inserting empty lines you could change the line spacing of individual lines by sending EM_SETPARAFORMAT messages to the Richedit. See this question

How to decrease line space of tRichEdit

for an example. To increase the line spacing change the value of "Para.dyLineSpacing". Use "500" to get an idea of the effect.

Community
  • 1
  • 1
Olaf Hess
  • 1,453
  • 11
  • 18
  • Well, i don't see how it could be applied to individual lines, and anyways as i said i found workaround with tab-symbol. – Markus_13 Aug 27 '16 at 15:05