From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean button changes color briefly when pressed

Solved!
Go to solution

Hi, I am using Boolean button as a toggle, so I only want text changes when it is pressed with no changes to button appearance.

 

I am able to change the color for On in properties to match the Off color (I am using the Silver palette so normally On is yellow), however when the boolean button is changes to On, there's a brief changes of color still. Is there any way I can get rid of it? 

 

In fact some of my buttons blink black while others blink yellow. I have no idea where that is set.

 

Thak you very much.

0 Kudos
Message 1 of 2
(4,364 Views)
Solution
Accepted by topic author jbphili

There are 4 colors for booleans ON and OFF plus going from ON to OFF and going from OFF to ON

You only see the transition color when you have the Mech latching set to "latch when released"

Set it to "Latch when pressed" and you will not see the transition colors

 

You can set all 4 colors by using the Colors [4] Property

 

Colors [4] Property

Short Name: Colors[4]

Requires: Base Development System

Class: Boolean Properties

To Use: Create a property.

Array of up to 4 (Foreground Color, Background Color) pairs, where Foreground Color is the foreground color of the Boolean control and Background Color is the background color of the Boolean control. Color pairs include False, True, True to False, and False to True.

You can set the color of the front panel object by wiring a hexadecimal number with the form RRGGBB or by wiring the color box constant to the property.

This property is similar to the Colors option on the Appearance page of the Boolean Properties dialog box.

If the Boolean control has four (Foreground Color, Background Color) pairs for the four states, this property always returns an array of four (Foreground Color, Background Color) pairs when reading. When writing, you can pass in an array of length 1, 2 or 4. If you pass in only one element, this property uses that element value for all four states. If you pass in two elements, this property uses the first element value for the False and True to False states. Similarly, this property uses the second element for the True and False to True states.

If the Boolean control has only one (Foreground Color, Background Color) pair for all four states, this property returns an array of one (Foreground Color, Background Color) pair when reading, and uses the first array element when writing. You cannot change a Boolean control with one (Foreground Color, Background Color) pair to a Boolean control with multiple (Foreground Color, Background Color) pairs.

This property only uses the True to False and False to True states when you set the Boolean control to latch or switch when released. You can get and set these (Foreground Color, Background Color) pairs even if you do not have the control set to latch or switch when released; they just are not used.

Because this property does not change the data of the Boolean control, you can set it at any time.

You can use the this property for Boolean controls on the Classic, Express, Modern, and Silver palettes. You cannot use this property for Boolean controls on the System palette.

Omar
Message 2 of 2
(4,351 Views)