09-19-2017 07:07 AM
09-19-2017 07:10 AM
09-19-2017 07:14 AM
Hello Sarah,
You can use "pict ring" or "Text & Pict Ring" in sub menu : Ring & Enum (front panel).
Regarts.
Fred.
05-11-2020 02:38 AM - edited 05-11-2020 02:41 AM
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....
05-11-2020 04:14 AM
.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.
05-11-2020 09:24 AM
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.
05-11-2020 10:21 AM
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.
05-11-2020 11:07 AM - edited 05-11-2020 11:11 AM
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.
05-11-2020 11:21 AM
The .NET solution works very nice. For other users interested a quick example can be found in attachment.
Enjoy!
05-11-2020 11:27 AM
I missed your last answer, while I was sandboxing with ToolStrips. Thank you very much!