LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add image to listbox

Hello,

 

I have one question, I have researched on google but there is not much information about this. I have a listbox with several data and an add button, is it possible to add an image to each item? That is, if I select a row and click on the button, I want to have the option of saving an image for each row in the gray box, and when rerun the VI to display the added image.

 

I don't know if that is possible.

 

Mocte117_0-1688341172308.png

I have an event case because this code is part of a larger code, so i removed what went inside just for example purposes.

Mocte117_1-1688341189359.png

 

 

0 Kudos
Message 1 of 4
(535 Views)

The listbox can't hold pictures, nor does it have a mechanism to link to pictures.

You would have to write all the code to do that.

0 Kudos
Message 2 of 4
(503 Views)

Hi mocte,

 


@Mocte117 wrote:

I have a listbox with several data and an add button, is it possible to add an image to each item? That is, if I select a row and click on the button, I want to have the option of saving an image for each row in the gray box, and when rerun the VI to display the added image.


Your listbox presents some data to the user - you "just" need to prepare the data to be displayed.

So your "data" can contain more information than is needed for listbox display - as you only display the data parts required to display.

Once you get this idea (of separating data structures in your VI from data formatting for display purposes) you can add any information you like to your data structure. One item to add would be a path to your image…

 

As has been said already you need to write some code to handle your requirement, the listbox itself will not do your work for free.

 

Btw. the listbox can display a small icon in the first column called "item symbol". There's a list of pre-defined symbols, but you can add your own icons to this list. This way you can also show (very small) images inside the listbox…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 4
(476 Views)

If the image should be shown in your big picture frame, then the easiest is to have a separate array of images that you index out based on your table.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 4
(467 Views)