Example Code

Change VI Controls to Flat

Code and Documents

Attachment

Description

 

An example of a VI which can be used to automatically alter the overall appearance of any specified VI. At present the VI changes numeric, text and boolean indicators and controls to all look the same, using the "Flat" appearance controls. The VI is handy if you have a large library of applications and dialogs built up over time and want to change them all to a similar appearance.

 

This VI can be modified easily for different colour schemes and/or control sizes. Buttons are changed to a flat appearance and a constant size, boolean indicators are changed to a flat rectangular LED style, and numeric/text controls are changed to a flat appearance. The VI panel colour is also changed. Controls placed on tabs and within clusters are automatically handled.

 

Two VIs are included in the ZIP file, one is "Controls.VI" which is a sample VI with a number of indicators/controls, and "Change Controls to Flat.VI" which goes through all of the controls on a specified VI and changes their appearance.

 

Before:

Screenshot 2019-11-13 at 19.57.19.png

 

After:

Screenshot 2019-11-13 at 19.58.10.png

 

One advantage of using the flat style controls is that the front panels look almost identical on Mac, Windows or Linux.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors