LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding image in combobox ?

Hi,
I can to Add an image in combobox in LabVIEW?
example:
Fig1.png

Thank you, 

0 Kudos
Message 1 of 10
(6,013 Views)

Hi Sarah,

 

you could use a picture ring…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(6,007 Views)

Hello Sarah,

You can use "pict ring" or "Text & Pict Ring" in sub menu : Ring & Enum (front panel).

 

Regarts.

Fred.

Message 3 of 10
(6,004 Views)

Pict Rings are NO combobox. I'm looking for a real combobox where all images are stacked on top of each others such as shown in the screenshot of the first post. Pict Ring shows the images next to each others... Does somebody have a solution? Using a .NET control maybe?

 

My hack solution so far was to create an array of images which is hidden, then a disabled pict ring and when clicking the pict ring, it shown the pict array and an event assign the picture from the array to the pict ring. Very tedious....

0 Kudos
Message 4 of 10
(5,182 Views)

.NET would work.

 

I've experimented with ToolStripDropDownMenu class before. IIRC, you can do pretty much everything in the .NET menus, even drawing things.

 

It won't be easy though. you've got ToolStripDropDownMenu, ToolStripItemCollection, ToolStripMenuItem, ToolStripDropDown, ToolStripSeparator, and a lot of boilerplate assemblies like Color and Bitmap. You also need to register for .NET callback events.

0 Kudos
Message 5 of 10
(5,169 Views)

If you are trying to make a control that looks like the one in your picture, you can use a table. I the table you an make the first column an icon and the second...n columns data. Then you could look for a click on the table and get the row for the click event. 

Tim
GHSP
0 Kudos
Message 6 of 10
(5,156 Views)

Thank you guys for your answers. I'll have a look to the .NET solution. The array solution is already similar to what I'm using, but as I want a drop down menu, it forces me to have a button that shows the array and when I click the array makes the array disappear and update the button.

0 Kudos
Message 7 of 10
(5,149 Views)

Here's a part of an old experiment, in LV13 VIs.

 

It's not a combo box, but a menu. You should be able to trigger it any way you want, including pressing a button that looks like the combo box drop down button, or maybe even the actual combo box button.

 

Good news is it seems to 'work'. Bad news is it needs work. It's a one-liner, except for the event callback VIs.

 

It does demonstrate toggle menu items, custom colors and custom icons. I have other parts of this experiment where I draw in the menu (like lines and such). But it's too big a mess to send it all.

 

It stops automatically after 5 sec. This is to ensure closure, and prevent hanging. Stopping the VI doesn't always stop external code (like .NET and dlls).

 

It should get you started.

0 Kudos
Message 8 of 10
(5,144 Views)

The .NET solution works very nice. For other users interested a quick example can be found in attachment.

 

Enjoy!

Message 9 of 10
(5,132 Views)

I missed your last answer, while I was sandboxing with ToolStrips. Thank you very much!

0 Kudos
Message 10 of 10
(5,128 Views)