Is there a way to insert a carriage return in a label field so it appears like
Part 1
Part 2
Instead of Part 1 Part 2
Carriage Return in a Label Field
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: Carriage Return in a Label Field
You can embed a carriage return as follows.
This can only be done at runtime at the moment.
This can only be done at runtime at the moment.
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<2015DeepOrange>)
Define_Com Class(#PRIM_LABL) Name(#Label1) Caption('Click Me') Displayposition(1) Ellipses(Word) Height(34) Left(112) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(24) Verticalalignment(Center) Width(169) Alignment(Center) Themedrawstyle('MediumTitle') Margintop(10) Marginbottom(10)
Evtroutine Handling(#Label1.Click)
#Label1 += (10).AsUnicodeString + "Now with another line"
Endroutine
End_Com
Re: Carriage Return in a Label Field
What about when the label is part of a list. The solution you describe does not appear to work.
Also, how do you make a label field in a list wrap ?
Also, how do you make a label field in a list wrap ?
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: Carriage Return in a Label Field
String columns in a list may look like a label, but they are in fact an edit, which means the carriage return will be ignored.
However, you can create a reusable part, implementing the Prim_list.iListCellDesign interface, and use this as a column in the list. As it's a reusable part, you can fill it with a label. This will show the carriage return properly.
Today, you'll have to set the row height manually. However, SP1 will introduce content sizing. This is a set of layout features that allow controls to resize to the their content e.g. the text in a label. This will allow you to add a row to a list and have the row change height.
However, you can create a reusable part, implementing the Prim_list.iListCellDesign interface, and use this as a column in the list. As it's a reusable part, you can fill it with a label. This will show the carriage return properly.
Today, you'll have to set the row height manually. However, SP1 will introduce content sizing. This is a set of layout features that allow controls to resize to the their content e.g. the text in a label. This will allow you to add a row to a list and have the row change height.
-
lansacoder
- Posts: 2
- Joined: Fri Aug 23, 2019 10:31 pm
Re: Carriage Return in a Label Field
Thanks for the tip on adding a carriage return with => (10).AsUnicodeString
This helped me generate a SasToken in LANSA vs. JAVA.
This helped me generate a SasToken in LANSA vs. JAVA.