LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set colors in multicolumn listbox's cells?

Hello,

 

Is there a possibility to set colors of multicolumn listbox's cell's texts programmatically?

0 Kudos
Message 1 of 24
(20,524 Views)

there is a property that changes the active cell color.

 

but I don't know about all of them

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 2 of 24
(20,517 Views)

Yes.

 

First set the active cell to the cell you want to manipulate (read the help on this terminal, -2,-2 selects the whole list box ...)

Then use

 

CellBG to set the background color of the cell

or

CellFontColor to set the font of the text.

 

Have fun!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 24
(20,490 Views)

Here's an example of how to find a certain cell value and color it. Remember to initialize all cells as white before doing this, or the cells that get colored will stay that way even when the data changes.

 

mc_listbox_cell_color.gif

Richard






Message 4 of 24
(20,483 Views)

Thank you very much for help. I tried and it worked.

 

Taron

0 Kudos
Message 5 of 24
(20,442 Views)

How do you initialize the color of the cells as white?

0 Kudos
Message 6 of 24
(20,118 Views)

@Fonzie1104 wrote:

How do you initialize the color of the cells as white?


 

 

Read what I wrote in post # 3 and use white as the color.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 24
(20,112 Views)

For everyone's edification...

 

Changing the background color of an individual cell is extremely slow.  It takes me about 15 seconds to set the background color of each cell in a particular column in a 1000x6 multicolumn listbox. Changing the entire row to the specified color is orders of magnitude faster, even though the same number of calls is being made to the property nodes.  Changing the text color is about twice as fast as changing the background color, but still unacceptably slow.  And yes, panel updates are being deferred. This problem exists in LV2009 through 2010SP1. A CAR (#188518) has been filed. Unfortunately, this severely impacts the GUI I had intended on using for a new application.

Message 8 of 24
(19,791 Views)

@wired wrote:

For everyone's edification...

 

Changing the background color of an individual cell is extremely slow.  It takes me about 15 seconds to set the background color of each cell in a particular column in a 1000x6 multicolumn listbox. Changing the entire row to the specified color is orders of magnitude faster, even though the same number of calls is being made to the property nodes.  Changing the text color is about twice as fast as changing the background color, but still unacceptably slow.  And yes, panel updates are being deferred. This problem exists in LV2009 through 2010SP1. A CAR (#188518) has been filed. Unfortunately, this severely impacts the GUI I had intended on using for a new application.


How about

 

defer, hide the list box, do the update, show the list box, undefer?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 24
(19,787 Views)

Just tried it - that makes no difference in performance, not that I would expect it to.  If panel updates are being deferred, I don't see what benefit hiding the control would be?

0 Kudos
Message 10 of 24
(19,777 Views)