LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Coloring multicolumn listbox

Solved!
Go to solution

Dear All,

I want to color the strings in the multicollumn listbox. I do it in a loop, looping through every listbox row and using "CellFontColor" property

image.png

The problem is that the process is pretty slow. I have few thousand rows in the list, and the list recolors in this way in tens of seconds. The colors of the rows are to be changed for example when a user clicks on a row, and when I click on the row #1000 I wait for 10 s until is has been recolored.

Is there any more proper (faster) way to dynamically recolor the multicolumn listbox?

Thank you.

 

0 Kudos
Message 1 of 4
(3,307 Views)
Solution
Accepted by topic author P.C.

Can you show your actual VI that is taking 10's of seconds?

 

Do you need to recolor every row, or just the ones that changed?

 

If you execute a property node for defer panel updates before and after the code that recolors (true before, false after) LabVIEW doesn't schedule all the screen refreshes and it should execute much more quickly.

0 Kudos
Message 2 of 4
(3,301 Views)
Solution
Accepted by topic author P.C.

@P.C. wrote:

The colors of the rows are to be changed for example when a user clicks on a row, and when I click on the row #1000 I wait for 10 s until is has been recolored. 


Do you only need to re-color the clicked row or all of the rows? It is probably important to only touch cells that actually change colors.

 

And yes, try to defer the panel updates while coloring. Please attach a simplified version of your code.

 

(EDIT: Ah, Ravens already said all that :D)

0 Kudos
Message 3 of 4
(3,280 Views)

Thank you, sirs,

Defering updates function seems to resolve my problem. I just was not aware of it before

0 Kudos
Message 4 of 4
(3,210 Views)