02-01-2023 09:03 AM
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.
Solved! Go to Solution.
02-01-2023 09:57 AM
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.
02-01-2023 03:57 PM
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.
02-01-2023 04:42 PM
Thanks! That works. Not too much clutter with that method.
02-01-2023 04:54 PM
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.
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.