问题描述:

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?

网友答案:

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';
网友答案:

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.

相关阅读:
Top