Line breaks in text field objects

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
7 posts • Page 1 of 1
afetzer
Posts:4
Joined: Mon Jul 30, 2012 10:46 am

Line breaks in text field objects

Post by afetzer »

Hi,

we are desperately trying to insert line breaks into text fields.

While \\n, for example is working for primitive text, it isn't for text fields. I was wondering if someone in the community has more experience with that?

Thank you very much in advance for all support provided!

fmulder
Posts:330
Joined: Wed Feb 03, 2010 9:46 am

Re: Line breaks in text field objects

Post by fmulder »

try \\r\\n (or \\n\\r)

share the fun
Frenk Mulder

joost.lijster@siemens.com
Posts:19
Joined: Wed Sep 21, 2016 1:51 pm

Re: Line breaks in text field objects

Post by joost.lijster@siemens.com »

Or, in case of rich formatting, use html ( )

RudiKreiner
Posts:198
Joined: Mon May 16, 2011 2:10 pm

Re: Line breaks in text field objects

Post by RudiKreiner »

. . . and in tool tip text you can use html formatting like in this example:
this.toolTipText = "" + dpGetDescription(dp_name) + "";

schneebergera
Posts:89
Joined: Sun Apr 03, 2016 5:52 pm

Re: Line breaks in text field objects

Post by schneebergera »

Hello,

please use different text field.
--> "Multiline text"

e.g.
main()
{
this.text("first row\\r\\nsecond row!");
}

best regards,
Andreas

fmulder
Posts:330
Joined: Wed Feb 03, 2010 9:46 am

Re: Line breaks in text field objects

Post by fmulder »

I'd prefer the following syntax:

Code: Select all

void main()
{
  this.text = 
    "First line\\r\\n"          // Note how you can put a string on multiple lines !
    "Second row\\r\\n"
    "Third row";
}
or

Code: Select all

void main()
{
  string strLinefeed = "\\r\\n";

  this.text = 
    "First line"       + strLinefeed         
    "Second row"  + strLinefeed
    "Third row";
}

Good luck with your multiline

Share + \\r\\n
The + \\r\\n
fun


Frenk Mulder

afetzer
Posts:4
Joined: Mon Jul 30, 2012 10:46 am

Re: Line breaks in text field objects

Post by afetzer »

Many thanks for the input to everybody.
The main issue for us, thanks to your feedback, turned out to be that a text field element is not the right one for multi-line text, but we have to use the multi-line element.

Always good to learn something. Again, thank you very much.

7 posts • Page 1 of 1