Discussion:
Changing array element properties?
(too old to reply)
TonyO
2005-08-15 21:10:47 UTC
Permalink
Hi,
 
I am using LV 7.1 and I'm trying to change the properties of individual array elements (text color & text bkgnd color).  I don't think this can be done with arrays.  I have over 50 elements in my array so switching to a cluster would be a mess.  Basically what I am trying to do is create a FP that looks something like the Jeopardy screen.  When a screen control is selected, I want to perform an action(subvi) and then change the text color & bkgnd color of the control such as green with black text when Pass or red w/ white text for Fail.
 
I could use a boolean array setup, but I have 4 different color schemes (Pass, Fail, N/A, untested) and haven't been able to figure this out yet.
 
Thanks in advance for any suggestions.  I don't want to write 50+ event cases.
 
Tony.
chilly charly
2005-08-15 21:40:47 UTC
Permalink
You are right : you can't modify the settings for the individual elements in an array.
What you should do is to use a table. Basically, it's a 2D string array, but you can modify the color of each cell separately. See the attached vi


Table colors.vi:
http://forums.ni.com/attachments/ni/170/137498/1/Table colors.vi
GerdW
2005-08-16 07:40:33 UTC
Permalink
Hello Tony,

you may also use an array of color boxes (perhaps in background of your
text). This way you can easily change the color: index the string array
to change the text and use the same index to change the color. No need
to use references or a hugh amount of seperate indicators. And you are
free in color choices: you can use up to 2^24 colors!

Loading...