shineworld 73 Posted June 22, 2022 It is embarrassing but I was not able to set a multiline text in a Button Caption. Usually in Delphi is only necessary to: MyButton.Caption = 'first line' + #13#10 + 'second line' What to get same behaviour in Python + DelphiVCL ? Share this post Link to post
Sherlock 663 Posted June 22, 2022 In Python a \n usually does the trick. As per your example: caption = 'First line \n second line' Note that there is no need to concatenate the string. 1 Share this post Link to post
David Heffernan 2345 Posted June 22, 2022 1 hour ago, Sherlock said: Note that there is no need to concatenate the string. As an aside, even in Delphi there is no such need. You can write 'first line'#13#10'second line' And even then, concatenation of literals is performed by the compiler, so the above code would result in the same codegen as 'first line' + #13#10 + 'second line' Finally, it is usually preferable to use sLineBreak rather than #13#10 so that your code is more expressive, and platform independent. 2 Share this post Link to post
shineworld 73 Posted June 22, 2022 Thanks for the replies. I've also missed to set WordWrap to True in button properties 🙂 Happens! Share this post Link to post