LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify multicolumn listbox in subvi

I want to create a subvi to change the background color of a row in a listbox. 

 

Why?  The listbox contains commands parsed from an xml file.  As various sections of the vi (front panel contains the multicolumn listbox) operateupon the commands they will call this subvi to remove the highlight from the command they processed and to highlight the next command in the multicolumn listbox.

 

A'

0 Kudos
Message 1 of 9
(4,107 Views)

I assume you know how to change the colors without using a subVI.

 

Just create a reference to your listbox and wire it as an input to your subVI. In the subVI, use a property node wired to that reference and do the same stuff.

Message Edited by altenbach on 01-07-2009 08:55 AM
Message 2 of 9
(4,105 Views)

In a loop use the listbox's ActiveCell property to select the cell to be operated on and then set the color property. Repeat for each cell of each row you want to modify.

 

Mike...

 

PS: this does not work for system listboxes.

Message Edited by mikeporter on 01-07-2009 11:57 AM

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 9
(4,102 Views)

I was walking down that road but couldn't get the reference onto the front panel so I could wire it.  Upon reading your reply I made a what the heck attempt to drag from block diagram to front panel - it worked.  I'll forge onward from that.

 

A'

0 Kudos
Message 4 of 9
(4,098 Views)

MrNatural wrote:

I was walking down that road but couldn't get the reference onto the front panel so I could wire it.  Upon reading your reply I made a what the heck attempt to drag from block diagram to front panel - it worked.  I'll forge onward from that.


Here's a better way:

Create the property node in the toplevel VI , then select the property node and do a "edit...create subVI". Voila! You have the subVI with the connector (and the correct reference in the toplevel) all already hooked up correctly. 🙂

 

Now edit and save the subVI and reuse it anywhere.

Message 5 of 9
(4,091 Views)

mikeporter wrote:

 

PS: this does not work for system listboxes.


 

This is NOT true as of LabVIEW 8.0.

0 Kudos
Message 6 of 9
(4,090 Views)

Thanks for all the good help.  All is well with most everything except I cannot discern the property used by the GUI. 

 

I can readily change the color of the active cell, including the entire row with column = -2.

 

I can creat a sub vi is a nice and tidy way.  

 

But ---

If I use the "operate value tool" to select a row of the multicolumn list box, that row gets a dark blue background.  However, I cannot determine which property will tell me or let me change that row number.  I anticipate that whatever is that property, programatically changing it will accomplish what I need to do.  

0 Kudos
Message 7 of 9
(4,072 Views)

Excellent! I haven't tried this for a while but I felt that it was a rather arbitrary limitation...

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 9
(4,065 Views)

MrNatural wrote:

But ---

If I use the "operate value tool" to select a row of the multicolumn list box, that row gets a dark blue background.  However, I cannot determine which property will tell me or let me change that row number.  I anticipate that whatever is that property, programatically changing it will accomplish what I need to do.  


Can you attach a simplified version of your VI?

0 Kudos
Message 9 of 9
(4,045 Views)