Can I Programmatically Change the Color of the Front Panel?

Updated Jul 23, 2019

Reported In

Software

  • LabVIEW

Issue Details

Can I programmatically change the color of the front panel?
 

Solution

In LabVIEW 6.0 and later, you can use Property Nodes to programmatically change the color of the front panel. LabVIEW 8.0 introduces panes on the front panel. This feature makes it possible to color sections of the front panel independently.


LabVIEW 8.0 and later
  1. Use the Property Node located on the Functions»Programming»Application Control palette.
  2. Right-click the Property Node and select Select Class»VI Server»VI»VI. By default, this references the current VI.
  3. Right-click Property on the bottom half of the Property Node and select Properties»Front Panel.
  4. Create another Property Node.
  5. Wire the second Property Node reference to Panel.
  6. Right-click Property on the second Property Node and select Properties»Panes[].
  7. Create another Property Node.
  8. Create a For Loop around the third Property Node to access all pane refnums or use the Index Array function to access a specific pane's refnum.
  9. Wire the Panes[] reference through the For Loop or through Index Array function to the third Property Node. Your wire should be a single refnum instead of an array. See the picture below.

  10. Right-click Property on the third Property Node and select Properties»Pane Color.
  11. Create three Close Reference VIs from the Functions»Programming»Application Controlpalette.
  12. Wire each reference from the three property nodes to a Close Reference VI.
  13. Right click on the Color property node and select Change to Write. Wire an input. A Framed Color Box control can be found in the Controls»Modern»Numeric palette.
If you right-click the Color property node, you can display other panel properties by selecting Help For Pane Color. Refer to the Color VI Front Panel 8_0.vi (attached below) for an example in LabVIEW 8.0.


LabVIEW 6.0 through 7.1 
  1. Use the Property Node located on the Functions»Application Control palette.
  2. Right-click the Property Node and select Select VI Server Class»VI. By default, this references the current VI.
  3. Right-click Property on the bottom half of the Property Node and select Properties»Front Panel.
  4. Create another Property Node.
  5. Wire the second Property Node reference to Panel.
  6. Right-click Property on the second Property Node and select Properties»Color.
  7. Create two Close Reference VIs from the Functions»Application Control palette.
  8. Wire each reference from the two property nodes to a Close Reference VI.
  9. Right click on the Color property node and select Change to Write. Wire an input. A Framed Color Box control can be found in the Controls»Numeric palette.
If you right-click the Color property node, you can display other panel properties by selecting Help For Color. Refer to the Color VI Front Panel.vi and Color VI Front Panel 6.1.vi (attached below) for an example in for LabVIEW 6.1.