LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading index of selected elements in listbox

I am writing an application to plot various parameters that are selected in a listbox.  I need to read which element are selected in the list box so I know which parameters to plot.   Also how do you change the justification of the names (left, right, center). 

I am using labview 7.0.  I have  looked in the forums but most the list box questions I have seen are for new versions of labview.
0 Kudos
Message 1 of 5
(4,585 Views)

Getting the selected elements in 7.0 is exactly the same as in new or older versions of LabVIEW. Assuming that you have the selection mode set to 0 or more or 1 or more, the listbox control is an I32 array. The contents of the array are the index values. To get the names of the selected items, right click on the control and select Create>Property Node. Right click on the property node and select Properties>Item Names. This is a string array with all of the item names in the list box.

You justify the text by highlightling the text and choosing the justify option from the Text Settings button on the toolbar.

Message 2 of 5
(4,579 Views)
That gets all the names in the list box.  How do you get only the Selected names?
0 Kudos
Message 3 of 5
(4,208 Views)
You can just loop through the selected items and index out the Item Names.
Message 4 of 5
(4,195 Views)
Exactly the answer I was looking for.  A picture is worth a thousand words, especially in LabVIEW.  🙂
0 Kudos
Message 5 of 5
(4,167 Views)