05-14-2009 06:49 AM
Hi,
I have a VI with some text on it (not a string). Is it possible to change the colour of the text programatically?
I can change the colour of the background of the text by using property nodes to determine its decoration ref, then wiring new colour values to the 'Colors' property.
Is a similar apprach possible to set the text color?
-i realise i could achieve a similar thing by replacing the FP text boxes with string indicators and wiring property nodes, but would prefer not to have to at this stage!
Cheers,
Blue
Solved! Go to Solution.
05-14-2009 07:31 AM - edited 05-14-2009 07:31 AM
Although front panel decoration do not have block diagram icons, it is possible to change some of their properties. If you access the Front Panel decos[] property list, you can return references to each front panel decoration item. However, the list of properties available for these front panel decorations is limited, so identifying your decoration will be difficult.
One option would be to cast to a Decoration>Text class, and check the error out. If this results in no error then you know you've found yourself a text decoration. Then, in a No Error case, check the Text property against the decoration you're looking for. If it matches, change the Text Color property.
Of course, remember to close all references (my example is unfinished, but runs ok).
05-14-2009 07:50 AM
I already have the decoration refs for the decorations i need to change, so it is only the 'class specifier' i need to add. Great!
Many thanks,
Blue
05-15-2009 08:19 AM
05-15-2009 08:44 AM
Yes, after successfully trying out the class identifier route i bit the bullet and re-did the front panel with strings. I guess in the long run it will be a better solution, especially as i have various sub-panels to co-ordinate as well.
Thanks, Blue.
05-15-2009 04:32 PM