Showing results for 
Search instead for 
Did you mean: 

How do I chng BGcolor of individual enum elements of a panel array ?

I am designing a LabVIEW 7.0 panel where there is an array of enumerations, where the number of elements shown is programmatically changed.  This panel object permits me to select (using the mouse when the application is running) the setting of each enumeration of the array.  To avoid having another coloured object in this (or any other) array, I would like to be able to programmatically change the background colour (or the text colour) of any given enumeration element (or elements), in particular, either RED or GREEN.
If this cannot be done, should I change this "array of enumerations" to some other type of panel object which contains these enumerations ?
0 Kudos
Message 1 of 5

I looked into your request a little bit more and I could not find a way to reference a single element in the array made of enums. If I create two references for two distincts elements in the array and I try to change their color property, I only get access to the last element that I referenced. This leads me to thinking that you cannot programmatically change the background color of any element you choose in the array, you only get access to the last element inside the array. Let me know if you want me to look into this a little bit further.


Rudi N.

0 Kudos
Message 2 of 5
You might be able to make the enum transparent and put a color box behind it. Set the color box control to whatever value you need. Then make a cluster of the enum and color box. Put this cluster into an array.
0 Kudos
Message 3 of 5
Not sure if this is what you need. If you need to make it wider, you might need to move the enum to the back inside the cluster. Then make the color box wider and move it to the back.
0 Kudos
Message 4 of 5

Another approach would use a picture ring with the picture being an image of the text with the proper colors.

These images can not be changed at run time so if you needed different colors at different times, then multiple version of the picture ring could be used and only show the one that is appropriate at the time.

the values from the ring can then be type cast as an enum to be used in the code.

It none of thes work-arounds are good enough, have you concidered sticking with the native functionality of the enum and using the "Disabled and greyed out" setting for the items that would have been red?


Message Edited by Ben on 08-18-2006 08:08 AM

Message Edited by Ben on 08-18-2006 08:08 AM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 5