08-09-2012 11:08 AM
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.
Solved! Go to Solution.
08-09-2012 11:27 AM
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?
08-09-2012 11:36 AM
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)
08-09-2012 11:38 AM
@Jeff Bohrer wrote:
When a unselected checkbox is clicked (Selected) what should happen?
Ahhh, unselected. Good call. Didn't think about that.
08-09-2012 11:42 AM - edited 08-09-2012 11:45 AM
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 so please also use pictures if you can't downgrade the vi.
08-09-2012 12:15 PM
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)
08-09-2012 12:15 PM - edited 08-09-2012 12:17 PM
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.
08-09-2012 12:32 PM
Very nifty, Jeff, and probably more intuitive for the end user than my initial checkbox idea too!