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.

UI Interest Group Blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Improved Listbox Icons

YoungZaphod
Member

ListBoxIcons2.0.pngThe standard LabVIEW listbox control has very archaic icons. So I made some improvements. You can use this control as a direct replacement for the standard control, but it looks a lot better.


This takes advantage of the properties for the listbox to load your own custom graphics.

Download from Seneca5

Comments
JeffreyH
Member

Thanks Craig, very nice!

One suggestion for improvement is to make the backgrounds of the symbols transparent so it also displays nicely if selection mode is set to highlight the entire row.

YoungZaphod
Member

Transparency is a great idea. I tried it, but it didn't seem to work for listbox icons. It appeared that LabVIEW does not support the transparency within a listbox (at least in LV 8.5, which I used for this). Back in LV 7, there was no PNG transparency at all. Is that possible that it is still not supported in some instances? Or perhaps something is going wrong between loading the icons from the file and inserting them into the control? Any thoughts?

Thoric
Trusted Enthusiast

With a little effort you can create a mask from the background colour for each symbol, then re-insert it into the listbox. Loop this for each symbol and you have transparent symbols!

listbox-trans.jpg

Thoric (CLA, CLED, CTD and LabVIEW Champion)


JeffreyH
Member

Don't know about 8.5.. I did a quick test in 8.6 by loading some images (png) of the Nuovola theme in a listbox.

These all have transparent BG's and this looks very nice, like in Thoric's post.

YoungZaphod
Member

You are right, it does work! I tried it a different way and transparency does work, even in 8.5.

There doesn't appear to be any difference between it and 8.6. The problem was something else: To make it easy to load all of the icons, I made one file with the icons all in a line. I have LV code to load it in, break it apart, and assign the icons to each of the listbox elements. It makes it easier to edit than dealing with a bunch of files.

However, the Get Image Subset.VI that I use to break the image into 16x16 icons strips off the alpha from the PNG. In goes the full 32-bit image, out comes the subset at 24-bit. Fortunately Get Image Subset.VI has code (in which you can see that the alpha is explicitly stripped off), so maybe I'll make a modified version of it when I get some time. Or maybe I'll just load file by file.

kalyanramuv
Member

Nice updated control box. How did you modify the standard labview icons?

Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
Member

Hello,

Is there a way to reuse your icons on a multicolumn listbox?

Thank you

Luiz Carlos Maia Junior
YoungZaphod
Member