LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Colours

Is it possible to change the colours of decorations in a LabView program
whilst the program is running?!

Cheers,
John
0 Kudos
Message 1 of 6
(2,917 Views)
The short answer is, "yes". The long answer is, "Yes, but it's not going to be easy". The only way to do this is is to get a reference to the decoration and set its Colors attribute. The problem is that the only way to get a reference to the decoration is by getting the Panel.Decorations[] property of the VI, which is an array of references to all the decorations on the VI's Front Panel. Unfortunately there is no way to single out which decoration is which. You will simply have to test to find which element in the array corresponds to your decoration of interest (if you have more than one decoration). Also, you need to close all of these references generated by property nodes, otherwise you will have a memory leak if you keep calli
ng the code in a loop. Take a look at the attached example.

Good luck,

Jim
Message 2 of 6
(2,917 Views)
Jim gave the correct answer. However you can simplify the task by importing the decoration in a boolean indicator and use its property node to change color.


LabVIEW, C'est LabVIEW

0 Kudos
Message 3 of 6
(2,917 Views)
can someone please convert to 6.0, interested in the closing references part.

thanks
0 Kudos
Message 4 of 6
(2,917 Views)
Here is a LabVIEW 6.0 version. I have also added Jean-Pierre's solution, a Boolean indicator that has had its images converted to decorations in the control editor. This is the best solution to your problem, in my oppinion, and possibly Jean-Pierre's too 😉

-Jim
0 Kudos
Message 5 of 6
(2,917 Views)
Thanks Jim
0 Kudos
Message 6 of 6
(2,917 Views)