LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to preserve the colour of an XControl?

Hi,

Just wondering if it is possible to preserve colour (and other visual characteristics) of an XControl. The attached llb contains an Example.vi which has two XControls on the front panel. They have different size because one has been resized before saving. The colour can be changed with the colour tool but unlike the size, this colour is not preserved when the Example.vi is reloaded. Is there an easy way to keep the colour or will I have to make a special routine in the XControl to achieve this?

Cheers
0 Kudos
Message 1 of 3
(2,696 Views)
Oops, didn't attach the file.
0 Kudos
Message 2 of 3
(2,693 Views)
Hi Tobias,

You need to program this functionality into the X control. First you have to include the colours property in the state information so it will get saved with the VI. Then you have to write these colour values to a property node of the control in the facade vi, in the Display State Changed event. Then I put in an extra mouse up event and when ever this event occurs I write the value of the colours for the control to the Display state.

See attatched control.

One proviso is that this only works if you left click with the paint tool, the mouse up event fire before the colour is changed with a right click select colour.

Regards

Jon B
Applications Engineer
NI UK & Ireland
0 Kudos
Message 3 of 3
(2,663 Views)