LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multicolumn list box word wrap cell height

Is there any way to word-wrap long text for each cell and auto size the height for a multicolumn list box?

Ex) if text is longer than say 12 charc, I want the cell to have the height of 2 lines/rows and expanded, instead of the text being one line and hidden until hovered by mouse.

 

ex) currently this

ricky48_0-1628477589466.png

I want 

ricky48_1-1628477626057.png

 

 

I've looked around and from threads dating all the way back to 2011, there has been no clear way to do it.

 

0 Kudos
Message 1 of 6
(1,248 Views)

How about data tables? Just realized I've changed it to a table a while ago..

0 Kudos
Message 2 of 6
(1,228 Views)

AFAIK word wrapping does not work with tables or listboxes. An alternative is to add line breaks yourself and enabling Autosize Row Height and Multi-line Input.

 

You can use Get Text Rec.vi to evaluate the width of a string and compare it to the available width of a column.

 

snip.png

0 Kudos
Message 3 of 6
(1,197 Views)

I tried adding my own line break, but this caused another issue.

I'm inputting english/chinese together into a single cell, but if the line break happens to land on a chinese charcter, given chinese uses 2 character in ascii, it scrambles the rest of the string. 

 

Would using a .net datagridview fix this problem, as in does it recognize the chinese as 1 charcter instead of 2? And does it support word wrap?

0 Kudos
Message 4 of 6
(1,171 Views)

@ricky48 wrote:

I'm inputting english/chinese together into a single cell, but if the line break happens to land on a chinese charcter, given chinese uses 2 character in ascii, it scrambles the rest of the string. 

 


Does this happen when you press the enter key while editing the text in the control on the front panel, or only when you programmatically insert a line break character through the block diagram? I can imagine inserting CR and or LF in the wrong spot with Unicode characters would mess up the display.

 

Unfortunately I don't know if any .NET element would support word wrapping. Another option could be creating an HTML file using the Report Generator Toolkit and displaying it using a browser in a .NET container.

 

snip.png

0 Kudos
Message 5 of 6
(1,164 Views)

@RamonG  已寫:

@ricky48 wrote:

I'm inputting english/chinese together into a single cell, but if the line break happens to land on a chinese charcter, given chinese uses 2 character in ascii, it scrambles the rest of the string. 

 


Does this happen when you press the enter key while editing the text in the control on the front panel, or only when you programmatically insert a line break character through the block diagram? I can imagine inserting CR and or LF in the wrong spot with Unicode characters would mess up the display.


Yes this happens to the text if i press enter key in front panel control as well. To bypass it i started using .net textbox for frontend, but in the backend it is still the same ascii string, so inserting linebreaks can potentially screw up the chinese text. 

 

I'm trying out .net datagridview but am still having trouble to get word wrap to work properly/automatically even with wordwrap=true, autosizerowMode=AllCells. So if i were to revert back to inserting my own linebreaks, I think the same issue would arise again...

 

Is the report generator addon free to use for labview base? My app needs to be able to display the datatable, insert into it, clear it, save to csv file, and load older csv file back into the data table to display. So i'm wary with using a web browser.

0 Kudos
Message 6 of 6
(1,142 Views)