Usually one would set it like this at runtime:
Label1.Caption := 'First line' + #13#10 + 'SecondLine';
but for some reason, this does not seem to work even if you turn WordWrap
on or off.
What is the solution to create a linebreak in TMS Web Core at runtime?
2
Answers
Found a better solution: In Design Time view the dfm as text
so you need to use
#13
between Line1 and Line2. Seems like you cannot use#10
in TMSThis answer helped me: https://stackoverflow.com/a/36641512/19420461
First note. You can use
sLineBreak
instead of#13#10
.sLineBreak
is a constant defined in theSystem
unit:I tested linebreaks on TMS Web Core on my side. It seems like the
TWebLabel
doesn’t support a linebreak (#13#10) in it for some reason. It does work in other controls such as aTWebMemo
.I did a test. Here’s me trying to add it to a
TWebLabel
and aTWebMemo
and you can see it working on the Memo, but not on the Label:There is however a way. You can use the following:
The
<br>
is the linebreak and that works: