cancel
Showing results for 
Search instead for 
Did you mean: 

Custom control color property

SOLVED
_Bryan
Active Participant
Solved!

Custom control color property

With the included controls like the OK boolean you can change the true or false color by going to Properties >> Apperance >>Colors.  Then click the color box to change the state color.  Is it possible to do the same with a custom boolean control?

 

  I have searched some and it does not sound like it is possible, but I figured that I would ask.  I have a diagram where I used some pipes from the DSC module image navigator to make some boolean pipes.  I just changed the properties for the different colors then pasted them into a boolean control for true/false cases.  But now I am thinking of changing the colors from gray/red to gray/green.  Is there an easier way than just starting over and making new booleans with the desired colors?  Or is there a better trick for custom controls I don't know?

 

Thanks

 

12 REPLIES 12
Will_S.
Active Participant

Re: Custom control color property

You should be able to control those colors programmatically for a Boolean control by right clicking on it on the block diagram and choosing Create >> Property Node >> Colors[4]. The context help (Ctrl-H) describes which pairs are used for True/False.
Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
_Bryan
Active Participant

Re: Custom control color property

On the booleans included with LabVIEW that works great.  But when I create a custom boolean that does not work.  So I am asking about custom booleans.

 

Thanks

 

Knight of NI

Re: Custom control color property

If you've replaced one of the states with an image then you won't be able to use Colors[] property to change the color for that state.
JÞB
Knight of NI

Re: Custom control color property

Custom boolean?  Well that depends on the level of customization.  An instance of a Strict type def control must have all of the same properties as the strict type def. (it will look and operate exactly like the definintion).  An instance of aa type def control must be of the same LabVIEW type.  you could programmatically reassign property values of a type def.

"Should be" isn't "Is" -Jay
Will_S.
Active Participant

Re: Custom control color property

This still works for a standard Boolean button. Other custom Booleans may involve pasted images which lay over the base and cover the color. Could you post the custom control you are working with?
Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
_Bryan
Active Participant

Re: Custom control color property

Message contains an attachment

Hello Jeff,

 

  I can't use strict type def's because each piece of pipe is a different shape/size.  I attached a sample control that shows what I am doing.  Are there pre-made boolean pipes somewhere? 

 

I wish there was a semi-strict type def so only the true/false images were strict but dimensions were not.

RavensFan
Knight of NI

Re: Custom control color property

The problem is that the control you attached is saved as a Strict Type Def, which means you can't change the colors of the booleans.  Make the control a regular Type Def.  You can create a property node on the VI of that dropped control and write to the Colors(4) property (a cluster of 4 colors).  When it is set as a strict typedef as you have now, that property can only be read, not written to.
_Bryan
Active Participant

Re: Custom control color property

Message contains an attachment

Here is a sample of the control as a type def and a vi with the Colors(4) property cluster.  I must be doing this wrong or not explaining it correctly.  So if you could look at the files and be able straighten me out I would appreciate it. 

falkpl
Trusted Enthusiast
Solution

Re: Custom control color property

You are not doing something wrong, this is just a limitation of labview that has frustrated me for years.  The colors array only works with decorations, which are very limited.  If you import an image to the true/false images That are not labView decorations then the color property are not used.  You do have one option which I cahe done to some suscess:  Import a semitransparent overlay as a decal over a solid decoration color, then change the color[] array and all is good.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA