LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I select the Disabled & Grayed color for a button ?

I see the palette selections for a button in the Controls custom editor Picture Item selection - these 4 color selections are for False, True, Switch when Released and Latch when Released states.

I cannot find a color palette selection for the Disabled & Grayed Out state of the button.

The reason I need this is because in the Touchpanel PDA module I have some buttons where the Disabled & Grayed Out color is indistinguishable from the Enabled color.

How can I affect the color palette for the Disabled & Grayed Out state of a button control ?

As a workaround I changed the button Boolean Text when the control is disabled but I would prefer to understand where the 5th state color comes from.

 

0 Kudos
Message 1 of 12
(7,954 Views)

Well, as the name implies, the grayed color is the regular color with a touch of gray. 😄

 

Maybe you should simply make the regular color a little lighter, for example.

0 Kudos
Message 2 of 12
(7,951 Views)

Interestingly I have tried that but the behaviour is still not suitable.

I have some buttons with the same False-state color in one VI, they disable & Gray Out fine with a noticeably gray color shift.

I used the color picker to copy those buttons' False-state color to the buttons that are giving me problems in another VI.

The Grayed Out state of the second VI's buttons in no way matches the Grayed-Out color of the first VI's buttons.

 

Hence the question about what really controls the Disabled & Grayed-Out palette selection ??

 

0 Kudos
Message 3 of 12
(7,925 Views)

Can you attach an otherwise empty VI containing some of the controls in question?

0 Kudos
Message 4 of 12
(7,917 Views)

Attached a VI with the two disparate buttons.

Larger one grays out well in Windows CE

Smaller one is pretty much the same color when grayed out in Windows CE

Both work acceptably, yet slightly different grayed-out colors, in Windows XP SP3.

Using LV2010

No difference in LV2009.

Using Touchpanel Module.

Have fun ! and thanks.

0 Kudos
Message 5 of 12
(7,911 Views)

Can you just use the system buttons?  They have the windows look-and-feel, and there is a big difference between "enabled" and "disabled and greyed out". The onlu problem with system button is that you can't give them a colour of your desire like you can with a standard button.  What you can do is customise it and replace the button my any image (PNG) you like

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 6 of 12
(7,898 Views)

Hi Bjorn,

    Thanks for the reply. I guess what I am hoping for is for a Labview developer with knowledge of the code, probably someone who works at NI, to look into their source code and say" this is how it works" and "here's why it might not work in your case". For example when I change the button state (any button) to "Disabled & Grayed Out" does the internal code add a constant RGB offset to the False-state color (the "touch of gray" referred to earlier) ?

It does not appear to do this.

What's the "graying out" algorithm doing to modify the displayed color ? How can I find out what's really happening in there ?

Specifically to your post - do you know why the system buttons have a big difference between enabled & grayed out ?

I think there's a small but significant difference between ending up with something that works, and possessing the knowledge of the mechanisms that make it work that way.

If this is not the right forum for that kind of response, then I understand.

0 Kudos
Message 7 of 12
(7,882 Views)

Hey Denver,

 

As previously stated by Altenbach and others, the "Disabled & Grayed out" option simply adds a tone of gray to the button.  It's a standard within our code that can't really be changed in your application, unfortunately.  If you are looking for a workaround, you can place an image of what you want it to look on top of the given button and hide/display it using property nodes. Hope this helps!

 

Regards,

Joe S.

0 Kudos
Message 8 of 12
(7,863 Views)

I don't know how to select the exact "Disabled and Greyed Out" color but I can tell you that under Windows XP and Windows 7 (don't know about Windows CE), it his highly influenced by the background color of your front panel.  I have attached an extreme example to demonstrate this functionality.  Now obviously, you don't want crazy green as your diasble color but you can essentially pick any color you want by changing the background color.  But just for a second, let's say you did want crazy green as your disable color but not as you front panel color, just drop a decoration onto the front panel, change, it appropriately to hide the visible area of the background, and set the color of the decoration to whatever "backgournd" color you wanted.  Again, I know this doesn't explain exactly how "greying out works" but it might be a suitable work around for you to finish your project.

 

Damien

 

Greyed Out.png

Message 9 of 12
(7,854 Views)

Similar suggestion for a workaround.  When I want a button to have a different greyed out color I will place it inside a classic cluster with transparent border and background color set to a nice blue.  Set the cluster to size to fit and you won't see it.  On the BD it costs you a single unbundle after the terminal.  Also be careful that you move the cluster and not the button.

 

I don't do this too often, but it is pretty quick and easy.

 

BluedOutButton.PNG

 

 

0 Kudos
Message 10 of 12
(7,835 Views)