LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the color of items in a tree control

Solved!
Go to solution

I need to change background of font color of the parent item of a currently added child. Everything I try fails. No error, it just doesn't happen. There is a fundamental thing I don't understand here about accessing the item. This is how I am trying to change the color on an item I just entered:

Image 1.png

 

Nothing changes.

 

Who can I change the background color of the last item I just entered?

0 Kudos
Message 1 of 8
(3,065 Views)
Solution
Accepted by topic author flycast

Set the active tag (Active Item -> Tag) property before setting the font color:

LucianM_0-1607724933983.png

 

Lucian
CLA
0 Kudos
Message 2 of 8
(3,047 Views)

Thank you. I am currently not setting the tag value but allowing the system to automatically set it. How do I retrieve the tag for the item I just created?

0 Kudos
Message 3 of 8
(3,043 Views)

I think I am not understanding what tag is and exactly how it is used.

0 Kudos
Message 4 of 8
(3,038 Views)

A tag is a unique identifier for every item in a tree.  If you don't assign one, whatever is put into the "Left cell string" becomes the tag.  If that is also blank, or if you try and create something with a tag that already exists, LabVIEW will add numbers to the tag to force it to be unique.

Message 5 of 8
(3,033 Views)

So a tag is like a key? 

How would I retrieve the tag that was automatically assigned when I created the item if the tag had a number appended by LabVIEW when it was created?

 

In my case my date may look like this:

 

Item1

   - Child A

   - Child B

Item2

   - Child A

   - Child B

 

When Child A is created over and over it will have a number appended to the end. I need to know what the system created for the tag based on what I said to make tag so I can look up the last created item.

 

0 Kudos
Message 6 of 8
(3,028 Views)

@flycast wrote:

Thank you. I am currently not setting the tag value but allowing the system to automatically set it. How do I retrieve the tag for the item I just created?


The output of "Add Item to End" is the tag if the item just created.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 8
(3,017 Views)

Sure enough! Thanks! That clears a lot up.

0 Kudos
Message 8 of 8
(3,014 Views)