From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read data and index from combobox

Solved!
Go to solution

Hi!

 

I have an array of comboboxes and I want to read from them the selected value and the index inside the combobox assigned to this value. Is that possible or there is a more efficient way to do it?

 

Thanks!

0 Kudos
Message 1 of 5
(2,369 Views)

Does it work?

 

Attach your code so we can see exactly how you are doing it, then we can suggest a more efficient way.

0 Kudos
Message 2 of 5
(2,282 Views)
Solution
Accepted by topic author Kanayel

It would be more efficient* to use an array of rings (dynamic, changeable items) or enums (static items, fixed at compile time). Both would automatically be an array of selected indices.

 

*Efficient in execution time, and in maintenance. It's not sure if it does what you want it to.

0 Kudos
Message 3 of 5
(2,265 Views)

Thank you for your help. I have been reading on forums about that and realized that I can't do that because I can't have many comboboxes of differents options inside the same array. I can't neither use cluster because the number of comboboxes in the data container changes on execution time. I ll find another way and try to explain it here in a few days.

0 Kudos
Message 4 of 5
(2,225 Views)

Real dynamic (combo box) controls during run time will be a problem (as in 'not possible') in CG LabVIEW.

 

You simply can't create controls on the fly. You can however create a large number of them, and show\hide what you need. Or if you have a diversity of controls, make a large number of subpanels and show\hide\insert what you need...

0 Kudos
Message 5 of 5
(2,209 Views)