LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Number background color

Solved!
Go to solution

Sorry for asking such a dumb question, why can't I make my number

background green. I've tried every combination of properties and can't

seem to get it to work. See my enclosed vi.

0 Kudos
Message 1 of 10
(4,878 Views)
Solution
Accepted by topic author Ben_01880

Text is in a CONTAINER, which has its own properties.

 

You are setting the background color of the CONTAINER.

 

The property you want is Numeric Text - Text Colors - BGcolor.

 

Not Numeric Text - Colors - BGColor.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 10
(4,876 Views)

Well This is what I did.

 

New Vi

Placed an integer indicator on FP, not a container.

Thats it.

0 Kudos
Message 3 of 10
(4,870 Views)

That worked.

Thanks

I don't know why it was called a container ?

 

0 Kudos
Message 4 of 10
(4,865 Views)

CONTAINER is my word not NI's

 

In general, anything that displays characters of text has a text container - it's an object within the object.

 

The container doesn't have anything to do with the indicator being a STRING or a NUMERIC, or a TABLE, or a whatever.  

 

It's sole purpose in life is to display text.

A STRING indicator will own one, a NUMERIC control will own one, a TABLE might own a bunch of them.

 

That is so that all text containers can be treated alike by all methods and properties that pertain to text.

 

And thus, it has its own set of properties.

 

Note that the TEXT has a complete submenu of its own, including a REFERENCE?

That means you can pass a reference to a text container around to various VIs and they don't know (or care) whether that text is in a STRING indicator or a NUMERIC control, or a Label, or what.  Anything you can do to text on a panel, they can do it without regard to where it is.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 10
(4,858 Views)

If you look at a NUMERIC's property list, you don't see TEXT, you see NUMERIC text.

This is a child object (I'm guessing here, I have no internal knowledge) of the TEXT container.

 

YOu can set the NUMERIC TEXT : TEXT property, and the value of the control reflects it.

 

Text Prop.png

 

 

I've been wanting a way to blank a numeric indicator, alas, you cannot set the NUMERIC TEXT: TEXT property to an arbitrary string: it'll just ignore you.  That's why they used a child object, I bet: it performs specific things (numeric validation) on top of the generic behavior of the TEXT container.

 

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 10
(4,853 Views)

I chased that game around for while.

Solution = very large hammer.

I created a box the right color for the blank field

I wanted, and set it to be the frontmost. Setting and clearing the

visability did the trick.  VERY KKKRUDE,  but it worked.

 

Thank for your help

 

0 Kudos
Message 7 of 10
(4,850 Views)

Yes, we all have to get crude now and then.

 

 

Notice that the numeric control/indicator will actually own THREE of the text containers:

One generic one for the caption.

One generic one for the label.

One numeric-style one for the actual value.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 8 of 10
(4,846 Views)

 


@CoastalMaineBird wrote:

 

I've been wanting a way to blank a numeric indicator, alas, you cannot set the NUMERIC TEXT: TEXT property to an arbitrary string: it'll just ignore you.  

 


 

Here is my current kludge to blank a numeric indicator:

 

BlankNumeric.png

0 Kudos
Message 9 of 10
(4,835 Views)

Yeah, that works and I've done that too.  I'd like something that works thru the DATA side, though.

That idea, and the one I looked at above, both use PROPERTIES, meaning that I can't use strict TYPEDEFS, and you can't use them in arrays.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 10 of 10
(4,816 Views)