LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to have a control with a list of boolean checkboxes?

I need to give my users a list of tests to choose from and then do just the tests they selected. Each element in the list would have a string for the test name and a boolean checkbox for the user to select. I'd like to be able to iterate the list of string/boolean.

 

If I create a cluster and make an array out of it I can't seem to either drag the array of cluster into the multilistbox or set the value of MutiColumn ListBox programatically using the following code:

 

flycast_0-1608231769350.png

 

I also managed to make a pretty MultiColumn ListBox but the check mark is just a picture and not a boolean:

 

flycast_1-1608232480304.png

 

flycast_2-1608232505124.png

 

How can I create a list of booleans with a ID string that I can iterate to see what is check and what is not?

 

0 Kudos
Message 1 of 5
(1,682 Views)

Why not just an array of clusters? What's the point of the MCLB in this?

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

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

I have used listboxes before where clicking (or double-clicking) an entry toggles the check mark symbol to e.g. a blank or an X.

 

(For example, In this application, I populate entries that have already been analyzed with a check mark symbol. In other applications I would toggle double-clicked entries in grey or even strikeout font to exclude them from global analysis (see picture below). There are plenty of possibilities ;))

 

altenbach_0-1608233943192.png

 

Message 3 of 5
(1,661 Views)

@flycast wrote:

If I create a cluster and make an array out of it I can't seem to either drag the array of cluster into the multilistbox or set the value of MutiColumn ListBox programatically using the following code:

 

flycast_0-1608231769350.png

 


The "value" of a listbox is an integer that indicates the selected row. (.. or an array of integers if multiple selections are allowed).

 

"Clusters" have nothing to do with any of this.

 

(As you figured out, the item names and symbols need to be set via property nodes.)

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

Hi flycast,

 


@flycast wrote:

How can I create a list of booleans with a ID string that I can iterate to see what is check and what is not?


Generic suggestion:

You can make a distinction between your internal data structures (like an array of clusters) and the data structures needed for "nice" indicators!

 

I really like MCLB controls as you can show a lot of information with lots of formatting options. But most often I create a smal subVI to convert from internal data structure to data needed for MCLB inputs (value vs. other properties)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(1,597 Views)