From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you use custome icons with listbox

I have been trying to add a custom sysmbol to a listbox.  I have folled the Tree Image VI example but have not had any luck.
I saw a post on this board that says to use a picture ring turned into a constant.  I am assuming that the picture ring constant is to be wired into the itemsymbol property. 
 
I have had no luck making a picture ring constant that can be used in the same manner as the listbox icon constant ring found on the numeric pallete.
 
Any help on this would be appreciated.
 
Thanks
Tim C.
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 1 of 11
(6,594 Views)
Okay I stumbled onto the answer
 
Making the symbol
1.  use a read function (BMP, JPG, PNG) to send a image to a picture control,  Front panel pallete Graph - Controls - Picture
 
2. once you have ran the VI once and populated the picture control goto the block diagram and right click the picture control and
create a constant.  Repeat for each sysmbol you wish to make.
 
Using the symbol
3.  Wire the picture constant to a picture to pixmap vi
4.  Create a Invoke Node Method for the listbox - Custom Item Symbol -  Set To Custom Symbol
5.  Wire the Lisbox Symbol Ring Constant to the Index of the Method  (this is found on the ndialog and user interface funnction pallete)
6.  Select the standard symbol you wish to replace with the custom symbol  OR wire a numeric constant of 41 or higher to add the symbol
to the symbol array.
7.  Create a listbox symbol visible property and wire a T constant to enable sysmbols to be visible
8.  Create a propert Item Symbols and select the item (row index) and enter the index of the symbol array to be used.
if your not using custom symbols this is were the Listbox Symbol Ring Constant is typically wired.
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
Download All
Message 2 of 11
(6,589 Views)
Broken VI , trying to compare string value to set symbols
 
Any Help would be appreciated
 
 
1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
0 Kudos
Message 3 of 11
(6,560 Views)
Tim,
 
The "ItemSys" property node of the listbox expects an array of integers corresponding to the symbol to use for each item in the listbox.  In order to set a symbol for each entry programatically you will want to move the property node out of your for loop and pass it an indexed array after the loop has completed.
 
See the attached screenshot for an example (which assumes the symbol for case "S&P" is the 41st symbol in the symbol list).
 
Hope this helps,
 
Simon H
Applications Engineer
National Instruments
 
 
0 Kudos
Message 4 of 11
(6,548 Views)

Update to allow reading of BMP files to show the idea of reading the BMP file then creating th econstant.

 

Best regards

Tim C.

1:30 Seconds ARRRGHHH!!!! I want my popcorn NOW! Isn't there anything faster than a microwave!
Message 5 of 11
(6,206 Views)

Can you make the picture in the listbox larger?

0 Kudos
Message 6 of 11
(5,493 Views)

Hallo!

Is it possible in a listbox to have the symbol in the right side of the item names (in your example the symbol is in the left side)

Thank you so much

monica

0 Kudos
Message 7 of 11
(3,351 Views)

Hi Monica,

 

no, listbox symbols are shown at the left side of the listbox item…

Best regards,
GerdW


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

Hi GerdW,

thank you very much for your answer.

Please can you suggest me a work around or a different indicator type to have names on the left side and symbols on the right side?

I would like to have something like the attached file (done by paint) in my user interface

thanks

0 Kudos
Message 9 of 11
(3,339 Views)

Hi Monica,

 


@scmm wrote:

Please can you suggest me a work around or a different indicator type to have names on the left side and symbols on the right side?

Use a 2D picture indicator and draw anything you like to show the way you like it…

Best regards,
GerdW


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