From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ListBox MutiLine

I am using a listbox control in my VI

I am populating it with strings that are created within the VI

My problem is, if the string length is too long I cannot see it in the listbox, it runs out of width.

When I right click on the control I can select multi line input but this only seems to work if I wanted to manually enter.

How I can I make it 'wrap'?

Thank you in advance

Lee

0 Kudos
Message 1 of 9
(3,307 Views)

Hi Lee,

 

it seems quite easy to put some line breaks in the strings:

check.png

"1 2" is marked as first line in the listbox…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(3,304 Views)

Good morning, thank you for your quick reply

Yes from your example, very straightforward.

My problem is that the contents of the list box are saved to a file which is then  read back in another VI and decoded and so I didn't want to introduce any further elements into the inputted string

0 Kudos
Message 3 of 9
(3,298 Views)

Hi Lee,

 

I didn't want to introduce any further elements into the inputted string

You don't need to "introduce further elements", you only need to put some line breaks into long strings to enforce word wrapping…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(3,291 Views)

If I use a line feed constant it gives me the desired look in the list box but as u can see, I also save this to a text file and I would prefer it was all on the one line?

 

0 Kudos
Message 5 of 9
(3,289 Views)

Hi Lee,

 

you only need to add those line breaks for the Listbox object names.

Nobody said you need to add them to your data written in the file…

 

(All you need to do is to branch a wire!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(3,284 Views)

Of course yes, thank you

Can I ask one more question on listboxes. Am I able to add a border to each row so that it shows a clear split between each row. I couldn't see how to do that

0 Kudos
Message 7 of 9
(3,281 Views)

Oops found it ... horizontal lines ....

Many thanks for your help

Lee

0 Kudos
Message 8 of 9
(3,280 Views)

Please mark the solution and kudoes are a great way to say "Thanks for the help."

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 9 of 9
(3,254 Views)