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 7
(1,008 Views)
Solution
Accepted by topic author 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 7
(997 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.

Message 3 of 7
(976 Views)

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

0 Kudos
Message 4 of 7
(954 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.

Message 5 of 7
(948 Views)

Seems like the only way is to enable the whole cluster and then disabling all the cluster elements except the one you need.

0 Kudos
Message 6 of 7
(190 Views)

@BayArea_Developer wrote:

Seems like the only way is to enable the whole cluster and then disabling all the cluster elements except the one you need.


Yes. You can have Disabled controls in an Enabled cluster, but not the other way around. The Cluster have higher disabling priority.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 7
(170 Views)