Showing results for 
Search instead for 
Did you mean: 

change font default text color to toggle boolean text

Go to solution

Hi All,


there is nice feature in LabVIEW, to toggle button text from black to white and vice versa when button is pressed, depressed.

Unfortunately it works only when font color is black (text).

Is there a way to change default text color to some other color in order to let LabVIEW do the toggle and not do it programmatically?



Change in Options >> Environment, does not seem to work.




0 Kudos
Message 1 of 6

I don't think so.


But if you do it programmatically, you can probably use a callback event. This would require only one VI to be added to your diagrams. This would reduce clutter in your main event structure\diagram. It also makes for a nice self contained and reusable peace of functionality.

0 Kudos
Message 2 of 6
I am not sure what you mean with callback event.

I've seen ActiveX and .NET callbacks but not for simple control. Could you explain more?
0 Kudos
Message 3 of 6
Accepted by Duri

You can wire a LabVIEW reference to the .NET\AX callback function. That's it!


The benefit is that the callback VI is started when the function is called, and automatically stops when the caller stops.


You'd want to avoid putting the button handling in your main code, because it will a) clutter your main functionality and b) produce code that is not reusable. Callback VIs can be started in one VI, and from that run on their own. This VI is easy to reuse, simply put the VI on your diagram and wire the reference(s).


Alternatively, you can start a dynamic VI, but it's a bit harder to manage the lifetime of this VI.


A third alternative would be to make an XControl...

Message 4 of 6

It's not just black and white.  When the text color is the same as the button color, LV will switch the text color to either black or white.  As far as I know, there's no way to change that.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 6

Thanks for idea.


I saw callbacks and was like, no, I do not have time for that right now. Then completely forgot about I asked something on the forum.


Got to it today and was amazed how easy to implement it is for my case. Example is attached for anyone searching for something similar.


Now I wish I spent more time looking into this topic. Need to refactor.

0 Kudos
Message 6 of 6