LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing text colours on a boolean control

@paul_cardinale wrote:

Perhaps something like this.


How did you actually make that?

0 Kudos
Message 11 of 21
(1,084 Views)

Hi marshaul,

 

customize a (classic) button using two different images for OFF and ON state…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 21
(1,073 Views)

But the text fields are fields, not part of a static image.

0 Kudos
Message 13 of 21
(1,068 Views)

Hi,

 

that's the boolean text...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 21
(1,061 Views)

Right. And the color changes with true/false change. And I'm wondering how he did that. 

 

That's quite literally the entire subject of this thread, btw.

0 Kudos
Message 15 of 21
(1,059 Views)

Hi marshaul,

 

And I'm wondering how he did that.

As I wrote before: customize a classic boolean button by replacing the images for OFF and ON states!

Did you read the LabVIEW help on "customizing controls"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 16 of 21
(1,051 Views)

@marshaul wrote:
@paul_cardinale wrote:

Perhaps something like this.


How did you actually make that?



Setting the "OFF" colors to white and the "ON" colors to black causes the boolean text to toggle between black (for OFF), and white (for ON).  Since I've imported images for the buttons, the Colors[4] property has no other effect (except on the boolean text).

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 17 of 21
(1,046 Views)

@GerdW wrote:

Hi marshaul,

 

And I'm wondering how he did that.

As I wrote before: customize a classic boolean button by replacing the images for OFF and ON states!

Did you read the LabVIEW help on "customizing controls"?


As it happens, I have read that. Since we're sharing non sequiturs, I've also read this thread *cough cough*. 

0 Kudos
Message 18 of 21
(1,044 Views)

@paul_cardinale wrote:

@marshaul wrote:
@paul_cardinale wrote:

Perhaps something like this.


How did you actually make that?



Setting the "OFF" colors to white and the "ON" colors to black causes the boolean text to toggle between black (for OFF), and white (for ON).  Since I've imported images for the buttons, the Colors[4] property has no other effect (except on the boolean text).


Ah, thanks. You're actually taking advantage of labview's automatic use of white text on a black (in this case only nominally "black") background. Which means you can only use white OR black and some second color, but not e.g. red and green. Which is why I couldn't figure it out before.

 

Thanks for responding to the question at hand instead of your own assumptions. 

0 Kudos
Message 19 of 21
(1,043 Views)

@GerdW wrote:

Hi marshaul,

 

And I'm wondering how he did that.

As I wrote before: customize a classic boolean button by replacing the images for OFF and ON states!

Did you read the LabVIEW help on "customizing controls"?


But he wants the boolean text to be changeable at runtime, so you can't use images of "OFF" & "ON".  You have to use the trick with the Colors[4] property to get boolean text to change color with the boolean state.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 20 of 21
(1,042 Views)