LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing static text on the front panel.

I'm looking for a way to change some of the static text on my front panel according to data read from a settings file, I've got the data from the file, but I can't find a way to generate a ref# for the static text and I would rather not use a text string.
 
Can this be done?
 
Robert.
0 Kudos
Message 1 of 7
(5,355 Views)
You will have to use a control or indicator in order to get a re# that you can change text info. If you use the classic controls on the front panel you can get then to look just like the static text that you typed in.
Tim
GHSP
0 Kudos
Message 2 of 7
(5,347 Views)
Not true. Smiley Wink

You can access the pane's "Decorations" property and then typecast the reference to a Text object, as shown below:



Obviously you would need to have something tell you if it's the decoration you want to change, like some initially pre-defined text or something else.


Message Edited by smercurio_fc on 02-13-2008 01:07 PM
0 Kudos
Message 3 of 7
(5,340 Views)
Note that the above sample assumes you have just text decorations. If you have other decorations, type-casting to a Text object will probably generate an error. You can check the Class Name of the decoration to find out what kind of decoration it is.
0 Kudos
Message 4 of 7
(5,333 Views)

Just as a note for the original poster.  You can obviously change the static text using the Decorations as shown.

In the end however I would suggest simply adding a string control or indicator coloring it transparent and using it as your "static" text.  It will be a lot easier and more robust.

0 Kudos
Message 5 of 7
(5,331 Views)

Evan,

Making the background of the string field transparent would work great too, how can I do this?  I create a property node for the string and I can find  coloring options for the lable, caption, text and background but there is always a box around the text that I can't get rid of.  While we're on the subject, does anyone know what the color code for the default grey background is?

Robert.

0 Kudos
Message 6 of 7
(5,316 Views)
The easiest way to make it transparent is to simple use the paint brush tool rather than programatically setting it.
 
The background isn't too hard, but the trick to getting the border colored is to right click on it and then notice that on the lower left of that color chooser dialog there is the rectangle that shows the color you are selecting.  Hit the spacebar and notice that you can select the left square, the right square, or both.  That represents the 2 colors of the objects.
 
So to get the string fully transparent use the paint brush tool on teh string itself, and then right click on the border, hit the space bar so the entire rectangle is selected and then choose transparent.  That should do it.
 
As far as the grey it is red 179, green 179, blue 179.
0 Kudos
Message 7 of 7
(5,307 Views)