05-07-2012 12:43 PM
Hello!
I'm trying to programatically change the text background color of the elements in a large cluster.
I'm using LabVIEW 2010 SP1. Attached is a test vi that I'm expermimenting with. The test cluster has 6 elements and the final cluster will have 140.
All elements will be the same data type.
Based on the rate of change of the element value, I have to change the background color.
Instead of creating a reference for each element in the cluster (as in my test vi), I'm looking for a way of changing the reference programatically. Is there a way?
I'm also considering building an array of references as a brute force alternative but I would like to see if there is something more elegant / efficient first!
Am I making sense?
thanks,
mike
Solved! Go to Solution.
05-07-2012 01:52 PM - edited 05-07-2012 01:54 PM
Mike,
You can get references to the elements inside the cluster from the cluster reference using property node: All Objects[]. This is an array of references to the controls inside the cluster.
Another way which might have advantages is to put a color box indicator behind each numeric. Color the numeric backgrounds Transparent. Then write the color to the color box. I did a quick modification to your VI to show this possibility. I did not adjust the size of the color box to match the numeric to emphasize what I did.
Lynn
Another note: If any of your users are color blind some of the combinations (black on red) might not be very visible.
05-07-2012 02:45 PM
Hi Lynn!
You gave me the clue I needed.
The AllObjs property node was the answer but it needed the "to more specific class" type conversion to go along with it - see attached.
Thank you very much!
mike