LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete clicked item from Listbox (Single Column)

Solved!
Go to solution

Hi,

 

There seems to many posts on deleting rows from multicolumn listbox programmatically but not from single column listboxes.

Woth the help of Blokk and 

Make an array of the items clicked in a list 

 

 

0 Kudos
Message 1 of 6
(4,725 Views)
Solution
Accepted by amithkuttan

Have an array of strings for the 'ItemNames' that go into the listbox and store it on a shift register. When you delete an item (e.g. from an event case), remove that item from the list (using delete from array) and write it back to the ItemNames property of the listbox. A single column listbox works in exactly the same way as a multicolumn listbox.

 

Delete From Listbox.png

 

(excuse the broken links to the properties - this happens when creating a snippet)


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 6
(4,712 Views)

Thank you so much Sam_Sharp. You've given me more insight into how to use Listbox.

 

May I ask why do you have the error out connected to the while loop?

0 Kudos
Message 3 of 6
(4,701 Views)
It's not really necessary - but it's just there to make sure that the property node executes (and writes the items to the listbox) before the while loop starts (dataflow!).

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 6
(4,693 Views)

@Sam_Sharp wrote:

 

(excuse the broken links to the properties - this happens when creating a snippet)


Use the Code Capture Tool rather than NI's built in VI snipped option and you won't have that problem.

0 Kudos
Message 5 of 6
(4,685 Views)

@RavensFan wrote:

@Sam_Sharp wrote:

 

(excuse the broken links to the properties - this happens when creating a snippet)


Use the Code Capture Tool rather than NI's built in VI snipped option and you won't have that problem.


Yes, although I have noticed that NI did apparently fix these issues with LV 2015 (but the CCT still has some advantages, like including the FP in the image or backsaving the snippet).


___________________
Try to take over the world!
Message 6 of 6
(4,669 Views)