LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you auto-size row height in a multi-column listbox with multiple lines?

I have a multi-column listbox containing four columns. The fourth column is for notes, which will be of arbitrary length; they can get to be very lengthy. I want the cells in the "notes" column to have a constant width. When the width of the text is wider than the cell, I want the cell to automatically adjust its height and go to the next line so that all of the text is visible. For example,

 

|<--CELL WIDTH-->|

 

 This is not the way ...I want the listbox cell to function.

 

 This is the way I

 want the listbox

 cell to function.

0 Kudos
Message 1 of 4
(4,273 Views)

Did you enable multi-line input, as the documentation for the control indicates? You would need to programmatically insert new lines in the text to get the row to autosize. If you search the forum for "autosize listbox" you will find this question has come up before, and examples have been posted showing how to autosize the columns. You should be able to adapt these to insert your new lines to perform the row autosize.

0 Kudos
Message 2 of 4
(4,262 Views)

Yeah, I looked at the responses for questions like mine. Most of them adjust the width of the column to fit the text, which is not what I want to do. I figured that I would have to programmatically insert new lines when the text gets too long, I just wanted to make sure that there wasn't an easier solution before I spend the time developing the code to do that since it will take some time. Thanks.

0 Kudos
Message 3 of 4
(4,246 Views)

Another option is to use an ActiveX control or .NET control. You can search the web for grids, and a few examples have been posted on the forums. A search should bring them up.

0 Kudos
Message 4 of 4
(4,233 Views)