LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Force a combo box to only work as a drop down

I must confess that in 30 years of LabVIEW programming, I have used plenty of rings and enums, but I have never used a combobox. Did I really miss out on something useful? 😄

0 Kudos
Message 12 of 21
(265 Views)

@altenbach wrote:

I must confess that in 30 years of LabVIEW programming, I have used plenty of rings and enums, but I have never used a combobox. Did I really miss out on something useful? 😄


I find them quit handy from time to time.

0 Kudos
Message 13 of 21
(262 Views)

@Mads wrote:

Absolutes have a tendency to trigger the engineering mind, has it not? 😉

 

Short answer: The use case is to avoid having to include conversion when we could have a ring control of string type that works as ring controls of other types...

The case that made me post the question right now though? That case is more of a distraction here: It involves initializing the value of hundreds of individual controls in a GUI from some source clusters (why not use the clusters in the GUI you might say..) by label name instead of by wiring...(more flexible, dynamic and with less clutter). This is currently achieved with very little and generic code, but it does not handle a difference in type between the individual controls and their cluster counterpart. Inserting conversion code for some controls will be less convenient and elegant.). In this particular case I happen to control the cluster types *and* the GUI so I can always choose to just change the clusters or add conversion in the GUI...So there is a clear and not too cumbersome solution, but one that I would not even need if combo boxes could be set to act like other ring controls / disable their search/autofill feature...

 


I think you best solution will be an XControl.  It could be a fairly simple one; depending on how many properties you want to expose.

0 Kudos
Message 14 of 21
(261 Views)

@altenbach wrote:

I must confess that in 30 years of LabVIEW programming, I have used plenty of rings and enums, but I have never used a combobox. Did I really miss out on something useful? 😄


LabVIEW developers know how to get by with what we have so that is understandable😉  The first features that came to mind when I tried to think far back just now are splitters and events. Or almost 30 years ago: Undo (!) :😆

0 Kudos
Message 15 of 21
(242 Views)

Customize the ComboBox.

See attached.

George Zou
Message 16 of 21
(223 Views)

I don't know if I fully understand what you're looking for.

This VI changes a click on the combo box to a right-click, shows a custom menu and sets the chosen entry as combo box value. 

If you hover over the combo box there is a edit cursor but when you click the string part you will get the menu.

But the custom menu isn't at the same location as the combo box menu.

Message 17 of 21
(208 Views)

@zou wrote:

Customize the ComboBox.

See attached.


That is very good, thanks George👍 

 

You colored the handle icon transparent and expanded it over the entire control, and replaced the original background item of the handle icon with an icon of the handle?🙂 

 

We stick to system style dialogs so I tried to get it to appear identical to (using a copy of the system style pull down handle etc), but did not succeeed sufficiently...so I will probably pass on this this time (I am not too worried about it not following the OS-style on other OSs, but for consistency...), but good trick to know. 

0 Kudos
Message 18 of 21
(200 Views)

@UliB wrote:

I don't know if I fully understand what you're looking for.

This VI changes a click on the combo box to a right-click, shows a custom menu and sets the chosen entry as combo box value. 

If you hover over the combo box there is a edit cursor but when you click the string part you will get the menu.

But the custom menu isn't at the same location as the combo box menu.


Good idea, thanks 🙂 It comes off visually a bit hackish / far from other system controls (regular system rings etc) though. George Zou's edited control is 95% there and would work 100% if not required to mix with other similar system controls.

 

Here is a video of what I hope to see as an alternative some day:

https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-dropdownlist-style-option-to-LabVIEW-combo-boxes/...

 

 

0 Kudos
Message 19 of 21
(194 Views)

The problem is that the system style can not be customized.  which also means we can not get parts of the system style combo box.  If use a png image then the ctrl are not resizable.

 

George Zou
Message 20 of 21
(139 Views)