LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selected Item in Listbox

Hi,

 

I have attached a pic which I got from another discussion. In that there is the selected item. I have been trying to find the selected item in labview 2011. I cant find it anywhere. Can you please help me access the selected item in labview 2011. Thank You.

0 Kudos
Message 1 of 5
(4,382 Views)

The 'value' of the indicator of the Listbox is an array of the indexes of the selected items. The 'ItemNames' property is the array of strings that make up the list of items. I think (??) if the listbox is configured to only allow you to select one item, the value is a scalar, rather than an array.

 

As per the picture - you can get the names of the selected items by indexing the 'values' of the listbox from the ItemNames.

 

The 'selected items' and 'selected item names' in the picture are just indicators on the wires.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 5
(4,374 Views)

Sam is right, but to add to this I made some wrapping code to make an interface where selection on a listbox is done using checkboxes, and it can return an array of strings, which are the selected items.

 

https://decibel.ni.com/content/docs/DOC-42155

0 Kudos
Message 3 of 5
(4,349 Views)

Hi Sam,

 

I am sorry. I am not  an expert in labview. I couldnot understand by indexing the 'values' of the listbox from the ItemNames. So could you please clarify. Thanking You. 

 

 

0 Kudos
Message 4 of 5
(4,341 Views)
I was just describing what is happening in the picture which you posted.

The 'Listbox' control contains an array of the indexes of the selected items. To get the names of those items (by index), you go through each of the selected items and get the name from the 'ItemNames' array (by index).

I suggest you take some LabVIEW tutorials - there's plenty of free training material around and this is pretty basic stuff. https://www.ni.com/getting-started/labview-basics/

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 5
(4,304 Views)