取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 9 条)
4,436 次查看

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
2 条消息(共 9 条)
4,433 次查看

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 项奖励
3 条消息(共 9 条)
4,427 次查看

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 项奖励
4 条消息(共 9 条)
4,420 次查看

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 项奖励
5 条消息(共 9 条)
4,418 次查看

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 项奖励
6 条消息(共 9 条)
4,413 次查看

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 项奖励
7 条消息(共 9 条)
4,410 次查看

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

Many thanks for your help

Lee

0 项奖励
8 条消息(共 9 条)
4,409 次查看

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

aputman
0 项奖励
9 条消息(共 9 条)
4,383 次查看