LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a list of checkboxes where exactly 2 must be selected at all times?

Solved!
Go to solution

I want to have a list of checkboxes or radio-buttons, where exactly 2 options must be selected at all times. At the moment, the list has between 2-4 enabled options (depending on other parts of the program). How can this be done?

 

- James

 

Sorry if this seems obvious - I wasn't able to find any seemingly relevant information on it.



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 1 of 8
(2,773 Views)

Can you clarify the behavior?

 

At start-up are there default values?

When a selected checkbox is clicked (Deselected) what should happen?

When a unselected checkbox is clicked (Selected) what should happen?


"Should be" isn't "Is" -Jay
Message 2 of 8
(2,764 Views)

I would describe this, but that would be a little hard. Try this as a base.

 

(I tried a snippet, but property nodes blow up)

Josh
Software is never really finished, it's just an acceptable level of broken
0 Kudos
Message 3 of 8
(2,761 Views)

@Jeff Bohrer wrote:

When a unselected checkbox is clicked (Selected) what should happen?



Ahhh, unselected. Good call. Didn't think about that.

Josh
Software is never really finished, it's just an acceptable level of broken
0 Kudos
Message 4 of 8
(2,758 Views)

Each option refers to a graph. I now have only three possible graphs (slight change), but only two display spaces. At start-up, graphs 1&2 will always be selected as default.

 

Graphs 1&2 will always be enabled, but graph 3 can be disabled (when not required) from elsewhere in the program. When graph 3 is disabled, it is made invisible and graphs 1&2 will always show (programatic reset needed for if graph 3 is disabled whilst still selected/visible); its checkbox will also be disabled/grayed. When graph 3 is enabled, the user will then be able to chose which two of the three graphs to show.

 

My initial thought train was that it would only be possible to select a checkbox, and not to unselect it (is there a way to catch this and stop it happening?).

 

 

 

P.S. I cannot view anything higher than Labview 8.5 Smiley Sad so please also use pictures if you can't downgrade the vi.



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 5 of 8
(2,757 Views)
Solution
Accepted by topic author J.Mamakos

simple.png

here is a simple demo using Enums and the disabled items property.  You can extend the approach to disable waveform 2 and set value to 0 and 1 when needed (Attached in 8.5) PNG from 2011 (not a snippet because of the p-nodes)


"Should be" isn't "Is" -Jay
Message 6 of 8
(2,744 Views)

Always forget to downgrade

 

 

Edit: I vote for Jeff's idea... more simple. For some reason my mind read checkboxes as listbox.

Only use mine if you need a lot more graphs.

Josh
Software is never really finished, it's just an acceptable level of broken
0 Kudos
Message 7 of 8
(2,744 Views)

Very nifty, Jeff, and probably more intuitive for the end user than my initial checkbox idea too! Smiley Happy



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 8 of 8
(2,733 Views)