LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling a Single Control within a disabled cluster

Solved!
Go to solution

Has anyone been successful in issuing an "Enabled" Property to a specific control within a cluster that is programmatically "disabled and greyed out".

Logically, it should simply overwrite the property of the single control (so long as order of execution is correct), but it does not seem to behave that way.

 

i.e. I have a cluster with 29 elements. I want to programmatically "disabled and greyed out" to 28 of them leaving 1 still "enabled".

 

I'm trying to avoid doing this by issuing separate "disabled" properties to each individual control within the cluster of elements.

 

Thanks!

0 Kudos
Message 1 of 5
(800 Views)
Solution
Accepted by MattMyers

What you want to do is not possible. However, a Cluster has a Controls[] property whose value is an array of references to all the contained controls. You can use this property to disable all controls in a single loop.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 5
(789 Views)

If one of the controls in the cluster should not be disabled, the cluster itself cannot be disabled. Enable the cluster itself!

 

As has been said, you can get all reference to the controls inside a cluster as an array of references and do whatever you want with it, e.g. iterate over a disabled property for each.

 

We can typically give much more specific advice of you would attach a simplified version of your code.

0 Kudos
Message 3 of 5
(768 Views)

Thanks! That works. Not too much clutter with that method.

0 Kudos
Message 4 of 5
(746 Views)

Quick note:

 

If you have an array of control references of arbitrary length that you are applying property changes to, you probably want to use the "Defer panel updates" property on the panel to make sure it doesn't take too long to execute.

 

https://www.ni.com/docs/en-US/bundle/labview/page/lvprop/pnl_defer_pnl_updts.html

 

Set it to True to start deferring, then do all of the property updates in the array, then set it to False to cause all of the updates to happen at once.

 

29 is right on the threshold where you'll start to notice this taking a while if you don't use the defer property.  If you ever get to the 100's of references you will definitely notice, or likewise if you attempt to update your 29 references multiple times a second.

0 Kudos
Message 5 of 5
(740 Views)