LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graying Out a Control without Disabling

Is there a way to gray out a control without disabling it?  The Disabled property node in a control allows you to programmatically Enable, Disable, or Disable and Gray Out.  I would like to be able to just Gray out instead of Disable and Gray Out.  Is there a property for controls like sliders, system radio buttons, numeric controls, and enums for this?

 

 

 

0 Kudos
Message 1 of 11
(7,333 Views)

I don't think there is a property to just grey it out and not disable the control.  As an alternative, you could use the color properties to make it look greyed out.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 11
(7,325 Views)

This would be possible with a strict type def that has been customized.  You would need to copy the images from the control's elements and edit them in another program (PowerPoint works) and set the pictures to look washed out.  Not really a programmatic way to do what you want.

 

For a programatic solution you would need to fool the UI by hiding a normal control and showing a second custom control with the washed out look and useing the value of the un-hidden control.  Pretty Ugly!


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 11
(7,309 Views)

Thanks.  I tried changing the colors.  I was able to change the color of the text associated with the control to look grayed out but I could not get the actual control to look grayed out (for example the slider).  Maybe I was not using the correct property on the control (I tried using the Property Slider->Housing Colors but got an error).  Do you know how to change the color of the actual control (specifically radio buttons, sliders, numeric controls, and enums) to look grayed out?

0 Kudos
Message 4 of 11
(7,308 Views)

greying out isn't really about changing the color- it actually seams to change the transprancy of the front layers of an object (It seams like all objects have a solid grey base layer.)  But we have no access to the transparancy of individual control we only have access to the transparancy of the vi FP.

 

Without a guru "lifting the hood" the best we can do is guess and try to "fake" it


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 11
(7,296 Views)

Just as a wild guess, I tried using an Event Structure.  Works better than expected for the slide, enum and system radio buttons.  Interesting behavior for the numeric control, you can use the increment/decrement buttons but can't enter a value directly.

 

On the one hand, an interesting experiment, on the other hand a word of caution.  One thing that really cheeses me off is non-standard GUI behavior.  Functioning controls which are greyed out fall into that category.

 

Now that you know how it is done, don't do it (IMO).

Message 6 of 11
(7,283 Views)

OK Darin- I'm on the wrong home PC now --- the teaser is "intreging"-  what did you do?


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 11
(7,271 Views)

In the Mouse Down? event I enable the control and in the Mouse Down event I diable and gray it out.

 

17699iB9F574BBA71397F3

Message 8 of 11
(7,260 Views)

Darin.  I would have spent days before I tried that approach!  NASTY behavior of the front panel.   I agree the experiment seams to reveal a bit about how the various components of controls are related and is worth some further "playing around" to peek under the hood a bit. 

 

More importantly- I totally agree with your "Don't do this!" caveat.  a user would barf if given a UI that responded that way.


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 11
(7,226 Views)

@Darin.K wrote:

In the Mouse Down? event I enable the control and in the Mouse Down event I diable and gray it out.

 

17699iB9F574BBA71397F3


But it works so well!

 

For the special case of the numerics, a cluge could use two controls to look like one and group them when done with the following.

 

The top one gets a transparent background.

 

The bottom one get set as disabled after setting the font color the same as the background color.

 

The bottom gives you control over the look while the top one provides the undersirable behaviour.

 

17767i38DD346BD7ADDBC2

 

Smiley Wink

 

Ben

 

Snippet No work. Smiley Sad See attached code.

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 11
(7,219 Views)