LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Force a combo box to only work as a drop down


@zou wrote:

Customize the ComboBox.

See attached.


Nice! And with a little tweak it should look like the System one (although it doesn't automatically update the looks)

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 21 of 26
(293 Views)

It seems that the combo box has a "bling spot" and unchecking the "Allow undefined values at run time" is not making the control bullet proof - here is a valid sequence how to force the combo box to yield undefined value by using just mouse clicks and keyboard presses during run time:

  1. You have a combobox with few items, "Allow undefined values at run time" is of course unchecked
  2. Run your application (in EXE or within LabView) and click on the edit field, just like you want to edit the content. You'll notice that typing has no impact on the shown value or you can select some of available items.
  3. And here is the "blind spot" - press with mouse at the beginning of the combo box string (before the first character) and then press <Delete> button - the text will disappear and now if you click away from the combo box the void value will reside in the control. If you have an event for the combo box change, at this moment you'll get a void string.

Because of this flaw I'm trying to avoid combo box controls.

BTW, the custom combo box control posted above also suffers from the same "blind spot" problem.

Message 22 of 26
(164 Views)

Empty string is a problem for ComboBox.

 

If config the ComboBox as following, when select the empty string from the pull down menu, it returns empty string instead of 2.  See test VI in 2018.

ComboBox.png

George Zou
0 Kudos
Message 23 of 26
(98 Views)

Agree,
the empty string is the weak point of the LabView combo box .

Enum / Ring types can behave as combo boxes (and I use them for this purpose all the time), but they don't have the small arrow to remind the user to press there are select the record. 

 

Luben Hristov 

0 Kudos
Message 24 of 26
(87 Views)

Pulldown Enum & Ring attached.

image.png

 

 

George Zou
Download All
Message 25 of 26
(69 Views)

This modified control works better, but has another non critical flaw - if the text is too long it overlaps the arrow key. 

 

ImageH031.png

 

I guess you used the standard enum & ring controls and customised them - you resized  the arrows on the left side and moved them on the right side, the arrow down is overlapping the arrow up. Also the arrows stay on layer below the text field, so when you click on the arrow you technically click in the enum/ring text field, which naturally shows the pull down menu.

 

Another inconvenience is that it's a custom control (type cast) and you can't just drag/drop it from a common library location and use it. After dropped on the panel, first you need to break the typecast link to the original *.ctl file and then save it to a new file (failing to do so may result in entangled misbehaviour - by changing a file in one project you may affect other projects which use the same typeCast control in wrong way).

0 Kudos
Message 26 of 26
(54 Views)