LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I programmatically change a label?

Hi everyone,
 
I have a 2-D array that I wish to populate with different sorts of data.  Depending upon the data, the names of the rows and columns may change.  Arrays have to have identical labels and I suppose I could simply populate a string indicator, but frankly, that looks like trash.
 
How can I programmatically change a label of a column or a row in a 2-D array?  Should I consider using a table?  I want it to look nice.
 
Thanks,
 
Jason
0 Kudos
Message 1 of 9
(6,030 Views)
I think the best option would be a table. You can display headers and write to either the Row Headers or Column Header properties. Both are a 1D array of strings. Unlike, string indicators, the row and column headers will move automatically as you scroll left and right through the table.
Message 2 of 9
(6,020 Views)

Hi

I do not think you are able to change the label programatically.

But you might consider to use Captions instead of labels. You can hide labels and make captions visible programatically, and you can change the text of the caption and size (see enclosed vi).

take care

Pawel

 

Message 3 of 9
(6,016 Views)
Yeah, that's what I'm looking into now - thanks for the info!  I guess I wish they had a better way to do this because I'd like to deal with data that isn't necessarily text.  I saw the following post about captions that that won't work because all elements must have the same caption.  Personally, I think that is a bit silly, although I do understand it would take a lot more memory to do it individually.
0 Kudos
Message 4 of 9
(6,015 Views)
Hi Jason,
      Without knowing more specifcs it's hard to know whether this is a good suggestion, however,
You could put string-indicators above each column and change what's displayed.  Making the background and border transparent makes the indicator look like a label.  Better, make an array of strings for the column-headers (again making array borders/background transparent.)
 
 
 
 
When they give imbeciles handicap-parking, I won't have so far to walk!
Message 5 of 9
(5,992 Views)

Yes, that was my first thought and it probably is the simplest solution.  However, it does appear to me that it "looks" visibly sloppy and detracts from the application's attractiveness.  I am going to have to play around and see what I can make look good - labels would be best, but you can't change them later.  Thanks for the idea about the array, though, that does improve things a bit.  Smiley Happy

Jason

0 Kudos
Message 6 of 9
(5,970 Views)
JasonWB,

Someone mentioned using "captions" already, why not go that route.  Captions are like a second label which are free to be changed at run-time.  I think the whole purpose why captions are there are to do exactly what you need.

Check it out.

Make a caption visible by right-clicking the control / indicator and choosing "Visible Items->Caption"

You might want to hide all the control labels and make the captions visible instead.  This will give the APPEARANCE of the labels changing at run-time.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 7 of 9
(5,957 Views)
Hi Jason
I though the same, but he needs to change the text for each column. You can not do that with captions.
 
cheers
Pawel
 
0 Kudos
Message 8 of 9
(5,954 Views)
Sorry, it should be Hi Shane :), so Hi Shane.
0 Kudos
Message 9 of 9
(5,950 Views)