LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree control cell font problems

Solved!
Go to solution

Hello,

 

Once again I am fighting with tree control issues.  I am trying to format a tree control to have alternating rows different colors for readability and also I need the first and last cell to have different font colors.  In the attached VI the first time I run it it works fine.  On subsequent runs the font colors change to black and then I am unable to change them again. 

 

Any advice would be appreciated

0 Kudos
Message 1 of 10
(4,202 Views)

Hey 7Ronin,

 

I tried opening your file and was not able to access the Initialize Sequence Tree.vi or the Tree Row Colors.vi.

 

 

Matt G.
Product Manager
National Instruments
0 Kudos
Message 2 of 10
(4,151 Views)

My apologies-  attached a snippet.  Hope that works. 

 

If you simply run the VI the first time around it works fine.  Running it again changes the cell text to black and no further changes to cell text color with property nodes will NOT work.  I literally have to delete the tree and make a new one for the cell color change to work.

 

Perhaps I am missing something obvious but....

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

SubVIs are missing.

 

The snippet only contains top level VI.

 

 

George Zou
0 Kudos
Message 4 of 10
(4,126 Views)

Hmm,

 

I have not worked with the snippets before so please excuse my ignorance....  I extracted the content of the subVIs and made a new snipped below

0 Kudos
Message 5 of 10
(4,118 Views)
Solution
Accepted by 7Ronin

Tree init.png

 

 

George Zou
0 Kudos
Message 6 of 10
(4,071 Views)

George,

 

That does indeed work- thanks for the help.  I am not sure why the method I was using would not accomplish the same thing, and in particular I am no clear at all as to why the cell font color changed on the second run (an seemed to stay stuck a black font) but in general the tree control seems very finicky.

 

Again- Thanks!

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

If you disable the last For-Loop in your code, it will work.

I don't know how NI implement Tree.  But I do know that controls, like listbox, multicolumn listbox, table, and tree, don't like set cell background color.

You have to set the background color by row, not by cell.

A redraw problem.

 

 

George Zou
0 Kudos
Message 8 of 10
(4,052 Views)

Hmm NI,

 

It looks like this needs to be addressed in a CAR- I lost HOURS related to trying to change the cell font color.  The solution provied by Mr.Zou works as long as one wants to chage the font color for an entire row.   In reality the Active Cell Font Color Property Node for the Tree  controls does not function as expected (if at all).  

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

7Ronin,

 

I will look into replicating and creating a CAR for this issue.

Matt G.
Product Manager
National Instruments
0 Kudos
Message 10 of 10
(4,006 Views)