LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set a HTML color to a control button

How to set a fixed color to a disabled button?

I have a boolean button which has 3 status: on, off and disabled. I don't like the 'grayed and disabled' option. I will use red for off, green for on, and white gray (foreground color) for the disabled status. The HTML color code is BDBDBD. I tried to send the hex number 'BDBDBD' to the button property node 'color[4]' but was told that I was wiring to the wrong type of terminal.

Could any one post a sample code of how to construct the structure of 'color[4]' using a RRGGBB number?

 

Thanks,

 

Ryan

0 Kudos
Message 1 of 10
(4,051 Views)
Just use a color box. It's on the Dialog and User Interface palette. Right click and pick your color.
0 Kudos
Message 2 of 10
(4,046 Views)

Is this what you're looking for??

 

Cheers,

-Matt from Cyth

 

p.s. Have a good weekend!!! 


LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
Message 3 of 10
(4,040 Views)

Dennis and Matt,

      Thanks. But somehow it does not work.

      I am using the button to start and stop a critical task. The task only runs ONCE. After the task finished, I disabled the button and set it to a different color from on or off. The attached figure shows how I change the text, color of the button, and then turn the switch off and disable it. Somehow after finishing the button shows the 'off' status color. I change the order of 'disable' and 'off' but get the same.

       In your sample code, can you turn the 'Disable Test Bool' button on and off once and then disable it and set it to the gray color?

 

Thanks and have a nice weekend,

 

Ryan

Message Edited by RyanWu on 10-02-2009 05:09 PM
0 Kudos
Message 4 of 10
(4,033 Views)

Honestly, it looks like a dataflow problem. Change the order in which you Disable, then change the color. Right now you're changing the color while it's in an enabled state, Then you set it to disabled and false.

 

Try changing it to disabled and false, then change the color. That should straighten out the issue.

 

I'm not sure what you're using this for, a better description of what you're using this for  would help give you the best solution.

 

Regards,

-Matt 


LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 5 of 10
(4,013 Views)

The colors of the Colos[4] property expect 4 colors:

  • T             Shown when the boolean is True
  • T->F       Shown when the boolean is changed from True to False
  • F              Shown when the boolean is False
  • F->T       Shown when the boolean is changed from False to True

I am not sure you are writing all 4 colors.

 

I don't consider this a issue of date dependency, setting the status to disabled (1) should not change the colors.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 6 of 10
(3,994 Views)

Thanks for all your help.

Here is a example code. I tried to change the foreground color of the slide switch. And finally I found the following post:

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=257168&query.id=575056#M257168

 

I am using LabVIEW 8.6. Does this question have the same answer?

 

 

Thanks,

 

Ryan

0 Kudos
Message 7 of 10
(3,974 Views)

What exectly do you want and do you see.

 

If I run the code you have in LabVIEW 9.0, I get the following result after running.

For convenience I have shown the second color array you set as color indicators:

 

Note that you use grey as the colors for True and False

 

Here I have set made the colors more distinct:

 

Ton

 

Message Edited by TCPlomp on 07-10-2009 08:00 AM
Message Edited by TCPlomp on 07-10-2009 08:01 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Download All
Message 8 of 10
(3,944 Views)

Ton,

     Thanks. It is a good method to debug the button colors. Could you please paste the code?

     Anyhow, my question was solved at this post:

http://forums.ni.com/ni/board/message?board.id=170&message.id=445780#M445780

 

Ryan

0 Kudos
Message 9 of 10
(3,932 Views)

Hi Ryan,

 

I used your code, just replaced the constant colors with a control, and replaced the numerics with color pickers.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 10 of 10
(3,905 Views)